Date: Tue, 15 Feb 2000 14:07:37 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Harry Hiratos cc: djgpp AT delorie DOT com Subject: Re: Question about the puts command in C++ In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: dj-admin AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Tue, 15 Feb 2000, Harry Hiratos wrote: > Employee Sarah; > cout << "Her salary is : " << Sarah.getMessage(); > > where Sarah is an object of class Employee. The function getMessage is > defined inline as follows: > > char getMessage() { puts( message ); } > > When I run this program, it prints the words "Her salary is : " on the line > immediately after the output of getMessage, instead of before it on the same > line. See section 9.5 of the DJGPP FAQ list, it explains this. In a nutshell, you (and the textbooks you use) forgot about buffering.