my teacher gave out an assignment pertaining to variable address. she wants us to add something to the program to display the address of the variables a, b, and c. and i can't seem to figure out how to do it and i'm on a tight schedule and i need it before May 11,2009. here is the program...
pls help me...Code:#include<stdio.h> void main(){ int a,b,c,i; a=1;b=2;c=3; trace(&a,&b,c);printf("%d %d %d\n",a,b,c); trace(&a,&b,c);printf("%d %d %d\n",a,b,c); trace(&c,&b,a);printf("%d %d %d\n",a,b,c); for(i=1;i<=3,i++) trace(&a,&b,c); printf("%d %d %d\n",a,b,c); getch();} void trace(int *x, int *y, int z){ int t; z+=*x; *x=*y+z; t=z; z=*y; *y=*x; *x=t; }



LinkBack URL
About LinkBacks




j/k