delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/08/13:35:45

From: "A. Sinan Unur" <asu1 AT cornell DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: gets();
Date: Wed, 07 May 1997 19:50:03 -0400
Organization: Cornell University http://www.cornell.edu
Lines: 28
Sender: asu1 AT cornell DOT edu (Verified)
Message-ID: <3371152B.2C38@cornell.edu>
References: <3370E625 DOT 5BBA AT epix DOT net>
Reply-To: asu1 AT cornell DOT edu
NNTP-Posting-Host: cu-dialup-0067.cit.cornell.edu
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Mr. Cup O. Slaw wrote:
> 
> 
>           printf("\nEnter the name of the room...");
>           gets(room);
> 
> 
streams are buffered which means output is not comitted until a newline
or flush is encountered. you can do:

printf("\nEnter the name of the room...\n");

or
printf("\nEnter the name of the room...");
fflush(stdio);

i recommend consulting the C FAQ before posting basic C questions.
-- 
   Sinan
 
*******************************************************************
 A. Sinan Unur                                WWWWWW
                                              |--O+O
 mailto:sinan DOT unur AT cornell DOT edu                C   ^ 
 http://www.people.cornell.edu/pages/asu1/     \  ~/ 

Unsolicited e-mail is _not_ welcome, and will be billed for.
*******************************************************************

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019