1. Engineering
  2. Computer Science
  3. consider a program with the following struct and variables struct...

Question: consider a program with the following struct and variables struct...

Question details

Consider a program with the following struct and variables: struct node f data; //4 bytes int struct node * link; // 4 bytes struct node * head; struct node ** ptr; Suppose after the running the program for a bit, the memory looks like the following, where variable head is at memory location 500. Address Contents Data Type Variable 1000 struct node 4 3000 1004 500 2000 1000 struct node * head struct node 2004 0 3000 struct node 3004 2000 Next suppose the following instructions are executed. Answer the following questions Instructions ptr- &head Questions After the instruction, what is the value in ptr? What is the value of *ptr? What is the value of (*ptr)->data? tr- &(ptr)->link) After the instruction, what is the value in ptr? What is the value of *ptr? What is the value of (*ptr)->link?

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution