Program:
#include <stdio.h>
int main(){
int array[5] = { 0,1,2,3,4} ;
int * p1, **p2 ;
int * parray[2] = { NULL , NULL };
p1= & array[2] ;
*p1 = 20 ;
p2 = & p1 ;
** p2 = 30 ;
parray[0] = & array[0];
parray[1] = & **p2;
*parray[0] = 30 ;
*parray[1] = 300;
}
Trace Table to Fill:
Example:
The following table is where you will be tracing your program;
* Use ??? to denote an undefined value; e.g. non-initialized variable.
* Use error to denote the dereference of a NULL or undefined pointer.
* As for previous exam, a given line should only modify the columns of the variables which it modified. However, because we use pointers, you might have to modify other columns if your line just dereferenced a pointer to modify another variable.
Trace Table: