Date: Wed, 12 Nov 1997 17:21:24 -0800 (PST) Message-Id: <199711130121.RAA04374@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: "Ashod" , djgpp AT delorie DOT com From: Nate Eldredge Subject: Re: wierd problem Precedence: bulk At 04:36 11/12/1997 GMT, Ashod wrote: > >I recently wrote this. > >void main (void) >{ >printf("\nHello"); >getch(); >} > > >// but it did it the wrong way round.... it displayed hello after I hit a >key, >any thoughts on this ?? stdio functions are buffered. The output is not done until you write a newline ('\n') or call fflush() on the stream. Also, intermixing stdio functions (printf, scanf) and conio functions (getch, cprintf) can lead to trouble. FAQ section 9.4 has more. (And yes, as someone pointed out, `void main' is incorrect according to ANSI and can lead to problems on some machines. You should always use `int main' and return 0 under normal conditions.) Nate Eldredge eldredge AT ap DOT net