Results 1 to 1 of 1
hi ,
i was trying out this experiment.
int a;
int main()
{
int b;
printf("%p %p",&a,&b);
}
having compiled with gcc on RHEL whenever i run the code the ...
- 06-26-2007 #1Just Joined!
- Join Date
- Jun 2007
- Location
- India
- Posts
- 4
virtual addresses of local variables
hi ,
i was trying out this experiment.
int a;
int main()
{
int b;
printf("%p %p",&a,&b);
}
having compiled with gcc on RHEL whenever i run the code the address of a is same(which i was expecting) but of b it changes every time i run the code.
can anybody plz explain to me why is it so.
arn't virtual addresses to the start of stack segments fixed.(maybe it has got to do something about that).


Reply With Quote