Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider the following program #define NAME-LEN 25 typedef struct int number; ch

ID: 3709751 • Letter: C

Question

Consider the following program #define NAME-LEN 25 typedef struct int number; char name [NAME LEN 1; int onHand; Part; void printPart(Part p) printf("Part number : %din.., p.number); printf("Part name: sn", p.name); printf("Quantity on hand: %d ", p.onHand); void printPartPtr(const Part p) printf("Part number : %an-, p->number); printf("Part name : %s ", p->name); printf("Quantity on hand: %an", p-oriand); What is an advantage of call printPartPtr instead of printPart? O It is guaranteed not to dereference a null pointer O It is more flexible since the function could change the structure's members if necessary O it is guaranteed not to cause a segmentation fault O It may be faster since only a copy of a pointer needs to be made when the function is called.

Explanation / Answer

Answer:

It is more flexible since the function could change the structure's members if necessary