Doubts in child process creation
0 Answers
Doubts in child process creation
| Flag | PURGE
Hi, I am new to using system calls. As I read somewhere if I create a child process using system call fork(). The child process will contain complete code after the call.
I wrote:
int main()
{
int i=10;
printf("I am parent %d",i);
fork();
printf("I am chile and parent %d",i);
The doubt is how come the variable i is acessbile in child proces. It should have its own stack
Email me when people comment.
Email me when people comment.
Loading...
An error occurred in subscribing you.
Email me when people comment.
Email me when people comment.
Loading...
An error occurred in subscribing you.
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.