![]() |
Trace program
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); } |
What do you mean you don't know how to trace the execution? Do you understand C or not?
|
See if your compiler comes with a built-in stepper tool. That program doesn't seem too difficult to follow, though.
|
All times are GMT -6. The time now is 05:03 PM. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
This site is best seen with your eyes open.