TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: FRANK MASINGILL
from: CLIFF RHODES
date: 1997-05-26 09:25:00
subject: getline?

--> Frank Masingill wrote to All  <--
FM>void main()
Frank, please use int main(void) !!!!
FM>        InFile.getline(buffer, MAX);
FM>        cout << buffer;
FM>    Instead of the expected result of the second file
FM>reading in the two lines as separate lines it is being read
FM>in as merged into one line.  What am I doing wrong?
getline() removes the '\n' at the end of the line--it doesn't store it
in buffer. So, when you display buffer you don't get the newline.
Use cout << buffer << '\n';
Cliff Rhodes
cliff.rhodes@juge.com
X CMPQwk 1.42 1692 X"What the imagination seizes as beauty must be truth." - 
John Keats
--- Maximus/2 3.01
---------------
* Origin: COMM Port OS/2 juge.com 204.89.247.1 (281) 980-9671 (1:106/2000)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.