| www.delorie.com/archives/browse.cgi | search |
| Date: | Tue, 15 Feb 2000 14:07:37 +0200 (IST) |
| From: | Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> |
| X-Sender: | eliz AT is |
| To: | Harry Hiratos <harrydhh AT ozemail DOT com DOT au> |
| cc: | djgpp AT delorie DOT com |
| Subject: | Re: Question about the puts command in C++ |
| In-Reply-To: | <dW6q4.26164$3b6.114795@ozemail.com.au> |
| Message-ID: | <Pine.SUN.3.91.1000215140629.25442G-100000@is> |
| MIME-Version: | 1.0 |
| 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 |
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.
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |