Question: Note: part b ( id initialized) Problem 2 (8 points): memory picture Consider the following struct definition. typedef struct profile( char first initial: double gpa:
Problem 2 (8 points): memory picture Consider the following struct definition. typedef struct profile( char first initial: double gpa: int id; char code; profile: Consider the code. profile mark 'M, 3.65, NULL, NULL) // picture drawn for you profile ptr&mark: /I update picture ptr->code & (mark.first initial) // update picture A. (5 pts) Update the drawing to show the memory layout after the code snippet executes. Use arrows to indicate the pointers (arrow head should point to the value stored at the memory address of the pointer). If a value is re-assigned, just cross it out and replace it with a new value. mark M' 3.65 NULL NULL ptr B. (3 pts) Suppose the following code is added to the bottom of the code snippet above and the code compiles: printf("Value of id: %d ", * (mark.id)); What is printed when the program runs (hint: is id initialized?)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
