From owner-freebsd-questions Sun Feb 7 10:41:06 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA26244 for freebsd-questions-outgoing; Sun, 7 Feb 1999 10:41:06 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from cd.mbn.or.jp (cd.mbn.or.jp [202.217.0.53]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id KAA26239 for ; Sun, 7 Feb 1999 10:41:03 -0800 (PST) (envelope-from mariga@cd.mbn.or.jp) Received: from gateway (cse5-1.kokubunji.mbn.or.jp [210.144.135.117]) by cd.mbn.or.jp (8.9.1/cd.mbn.or.jp-2.0) with SMTP id DAA13519 for ; Mon, 8 Feb 1999 03:41:01 +0900 (JST) Message-ID: <000601be52c8$2b4f32a0$064ca8c0@gateway> From: "Masahiro Ariga" To: Subject: Is my BSD wrong installed? Date: Mon, 8 Feb 1999 03:31:49 +0900 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.2106.4 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG My name is Masahiro Ariga. I had a spare PC,so I installed Free BSD on it and began studying UNIX programing.Although I made some C programs on Windows environment,I am completely at lost in UNIX programing so I bought UNIX program book and made sample run on my BSD machine. But its output never become the same as the book's answer.I cannot tell it is because of my BSD machine being wrongly installed,or it is because "That's UNIX." Please teach me. Sample is as follows, [Sample program] #include main() { if(fork()==0) printf("I am son!\n"); else printf("I am father!\n"); } And,Book says it's output should be, % sample I am son! I am father! % ■ ----■ is cursor mark. But my machine's output is as follows, % sample I am father! % I am son! ■ Here,two questions arise, (1) why my output is father's line and son's line exchanged ? (2)On second output,why % mark appears first,and why not returns to normal prompt. I beseech senior UNIX programmers to teach me. My mail address is mariga@cd.mbn.or.jp Sincerely yours, To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message