LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs > anshu33331
User Name
Password

Notices


Uncategorized Entries with no category
Old

fork() not giving desired result

Posted 07-31-2009 at 03: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
LQ Newbie
Posted in Uncategorized
Views 1133 Comments 0 anshu33331 is offline

  



All times are GMT -5. The time now is 10:25 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration