Date: Sun, 29 Jun 1997 16:01:24 +0300 (IDT) From: Eli Zaretskii To: Justin Talbot cc: djgpp AT delorie DOT com Subject: Re: printf() and shl Questions In-Reply-To: <33B59082.F71@sandiegoca.ncr.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Sat, 28 Jun 1997, Justin Talbot wrote: > void main(void) > { > printf("Hello world"); > getch(); > } > The computer waits for me to press a key, then prints "Hello world", > then ends. The compiler esentially switches the two function calls. > This also happens if I place two getch()s after the printf() statement, > except it waits for two key presses before printing "Hello world." > > Am I doing something very wrong? Yes, you are doing something wrong: you don't look in the FAQ before posting. This question is answered in section 9.4 of the DJGPP FAQ list (available as v2/faq210b.zip from the same place you get DJGPP).