0

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:
4a87987716fb73250a82a45dcdd802e8

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:
a115df082323dc75e815a8829116777f

Edited by finders

2
Contributors
1
Reply
12
Views
3 Years
Discussion Span
Last Post by L7Sqr
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.