Zelaron Gaming Forum

Zelaron Gaming Forum (http://zelaron.com/forum/index.php)
-   Tech Help (http://zelaron.com/forum/forumdisplay.php?f=329)
-   -   Trace program (http://zelaron.com/forum/showthread.php?t=34743)

deadlock75 2004-11-27 12:18 PM

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);
}

WetWired 2004-11-27 04:41 PM

What do you mean you don't know how to trace the execution? Do you understand C or not?

Demosthenes 2004-11-27 05:03 PM

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.