www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/02/15/02:18:46

From: "Harry Hiratos" <harrydhh AT ozemail DOT com DOT au>
Newsgroups: comp.os.msdos.djgpp
Subject: Question about the puts command in C++
Lines: 20
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2615.200
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200
Message-ID: <dW6q4.26164$3b6.114795@ozemail.com.au>
NNTP-Posting-Host: ts55056.powerup.com.au
X-Trace: ozemail.com.au 950598409 203.147.172.56 (Tue, 15 Feb 2000 18:06:49 EST)
NNTP-Posting-Date: Tue, 15 Feb 2000 18:06:49 EST
Organization: OzEmail Pty Ltd, Australia
Distribution: world
Date: Tue, 15 Feb 2000 17:04:35 +1000
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I have written a program which includes the following lines:

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.

Can someone explain to me why this happens, as I have not been able to find
an answer in my C++ text books?

Regards Harry


- Raw text -


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