ColdFusion

Moderators: None (Apply to moderate this forum)
Number of threads: 19
Number of posts: 30

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
problem with static... Posted by anandprm on 15 Jul 2009 at 2:05 AM
I have a code written as follows.
#include<stdio.h>
#include<unistd.h>

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.

Report
Re: problem with static... Posted by PerlongFiona on 27 Mar 2012 at 12:23 AM
I think you should turn to a professional.
Report
Re: problem with static... Posted by PerlongFiona on 27 Mar 2012 at 12:25 AM
I think you should turn to a professional.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.