thanks a lot guys :)
On Aug 15, 12:32 am, SuDhir mIsHra sudhir08.mis...@gmail.com wrote:
2)
int main()
{
fork();
fork();
fork();
fork()
printf(Hello world!);
}
a.out─┬─a.out─┬─a.out─┬─a.out───a.out
│ │ └─a.out
http://faq.programmerworld.net/networking/unix-interview-questions-answers.html
refer 16 th ques in this site .. they ve told 2^n times..so only i asked
whether its compiler dependent ??
On Sun, Aug 14, 2011 at 11:12 PM, sivaviknesh s sivavikne...@gmail.comwrote:
int main()
{
fork();
search in group archive,
this question has been discussed very deeply
On 14 August 2011 23:14, sivaviknesh s sivavikne...@gmail.com wrote:
http://faq.programmerworld.net/networking/unix-interview-questions-answers.html
refer 16 th ques in this site .. they ve told 2^n times..so only i asked
Check out second run of same code: http://ideone.com/TK4qu. This time it
printed only 8 times.
The reason behind this is that, you are using a web based compiler and it
sends back the output as soon as main completes its execution. However
forked child are yet to complete.
--
You received
do somebody tried the redirecting the output to file???
sometime results are unpredictable
Thank you,
Siddharam
On Sun, Aug 14, 2011 at 11:25 PM, Yasir yasir@gmail.com wrote:
Check out second run of same code: http://ideone.com/TK4qu. This time it
printed only 8 times.
The reason behind
it is working fine try it on any version of gcc or g++ compiler
thread closed *
On Sun, Aug 14, 2011 at 11:47 PM, siddharam suresh
siddharam@gmail.comwrote:
do somebody tried the redirecting the output to file???
sometime results are unpredictable
Thank
2)
int main()
{
fork();
fork();
fork();
fork()
printf(Hello world!);
}
a.out─┬─a.out─┬─a.out─┬─a.out───a.out
│ │ └─a.out
│ ├─a.out───a.out
│ └─a.out