LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Blogs
User Name
Password

Notices


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 642 Comments 0 anshu33331 is offline

  



All times are GMT -5. The time now is 02:36 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration