Thread: Trace program
View Single Post
 
Trace program
Reply
Posted 2004-11-27, 12:18 PM
I need some help I only now what its going to output but the only problem which I do not know how is trace the execution.

#include <stdio.h>

main()

struct aa{
int x;
char z; } *p, *q;
p=(struct aa*)malloc (sizeof(struct aa));
p-> x=5;
p-> z='X';
printf("x's field %d, z's field %c \n", p->x, p->z);
free(p);
q=(struct aa*)malloc (sizeof(struct aa));
q-> x=6;
q-> z='Y';
printf("x's field %d, z's field %c\n", p->x, p->z);
printf("with q x's field %d, z's field %c\n", q->x, q->z);
}
Old
Profile PM WWW Search
deadlock75 is neither ape nor machine; has so far settled for the in-betweendeadlock75 is neither ape nor machine; has so far settled for the in-between
 
deadlock75