LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Blogs > anshu33331
User Name
Password

Notices

Rate this Entry

fork() not giving desired result

Posted 07-31-2009 at 04:49 PM by anshu33331

Quote:
Originally Posted by anshu33331 View Post
main()
{
printf("LINUX");
fork();
printf("UNIX");
}

expected result is LINUX UNIX UNIX.
actual result: LINUX UNIX LINUX UNIX

But if i write
printf("LINUX\n"); in line 3

it is giving expected output.

can anybody give the justified answer..




thanks everybody
Posted in Uncategorized
Views 619 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 04:24 PM.

Main Menu
Advertisement

My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration