Question: Question 17 (4 points) You are given a declaration for a struct person_t in which we keep the name, age and height of a

Question 17 (4 points) You are given a declaration for a struct

Question 17 (4 points) You are given a declaration for a struct person_t in which we keep the name, age and height of a person. You are also given the function print_person that takes an instance of struct person_t and prints it. The main function is also given. Modify the function print_person to take a pointer to person_t. Do the necessary changes in main to call the updated function. You should not change the given structure or the function return type. On the ruled lines given, rewrite the function and the main #include typedef struct person { char name [20]; int age; float height; } person_t; void print_person (person_t pl) { } printf("Name: %s ", pl.name); printf("Age: %d ", pl. age); printf ("Height: %.2f ", pl.height); int main() { = person_t personl {"John", 25, 1.75}; print_person (person1); return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres the modified code with an explanation Modified Code include typedef struct ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!