[algogeeks] Re: fork() question

2011-08-15 Thread siva viknesh
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                            

[algogeeks] Re: fork() question

2011-08-14 Thread sivaviknesh s
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();

Re: [algogeeks] Re: fork() question

2011-08-14 Thread Dipankar Patro
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

[algogeeks] Re: fork() question

2011-08-14 Thread Yasir
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

Re: [algogeeks] Re: fork() question

2011-08-14 Thread siddharam suresh
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

Re: [algogeeks] Re: fork() question

2011-08-14 Thread shady
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

Re: [algogeeks] Re: fork() question

2011-08-14 Thread SuDhir mIsHra
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