Consider the following structure declaration: struct Item {int invenNum; double
ID: 3774086 • Letter: C
Question
Consider the following structure declaration: struct Item {int invenNum; double cost; int quantity;}; Item tool; Which function prototype can be used for a function that displays tool's cost? void display(Item tool); void display(double tool, cost); either a or b. neither a nor b The function whose prototype is Item getData(); returns___ The address of a structure a copy of a structure a pointer to a structure nothing The function whose prototype is void getData(Item & thing); receives___ a pointer to a structure a reference to a structure a copy of a structure nothing The function whose prototype is void getData(Item * thing); receives a pointer to a structure a reference to a structure a copy of a structureExplanation / Answer
1)
ans. B
your option is correct.why because you can display the cost of tool by using option A also but displaying only cost option B is coorect.
2)
ans. B
it is general return type by value not address. if function prototype is like Item* getData() then it returns the address of the value(structure)
3)
ans. B
it uses the reference operator'&'. to get the reference of structure instead of value.
4)
ans. A
it uses the pointer operator for parameter passing(declaration).