problem with static... - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

problem with static...

anandprmanandprm Posts: 2Member
edited October 2013 in ColdFusion
I have a code written as follows.
#include
#include

int main()
{
static int i;
printf("%d", &i);
sleep(10);
}
I compile the code and run the ./a.out in background(&)
and I run the same ./a.out again. The value of the address
of i is same. can any one explain me why. I think two are different processes and they should have their separate data segment.
Thanks In advance.

Tagged:

Comments

Sign In or Register to comment.