...

View Full Version : A simple question [but I dont know how to answer =.=]



luvTN
09-09-2007, 06:32 PM
In class, xxx changed a program which had

printf(“Before\n”); fork(); printf(“After\n”); to

printf(“Before”); fork(); printf(“After\n”);

In the first case, the code printed out
Before
After
After


In the second case it printed
BeforeAfter
BeforeAfter

Explain in your own words (and diagrams if needed) what is happening.

Can anybody help me?

ghell
09-09-2007, 09:59 PM
See the sticky about homework assignments.

Gox
09-09-2007, 11:26 PM
Furthermore, you may want to read about fork(). http://www.csl.mtu.edu/cs4411/www/NOTES/process/fork/create.html



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum