TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: PETER HAYWOOD
from: JOHN PARKER
date: 1998-02-08 22:34:00
subject: C++ Saveding stuff

Peter Haywood was mentioning something about C++ Saveding stuff :
PH>  This works, except for one thing. cin only reads up to the first
PH>whitespace. What this means is that if you enter "Cyber Con", it will
PH>only read "Cyber". With my limited knowledge of C++, I'll leave it to
PH>the experts to tell you how to deal with this. But, a simple solution
PH>that comes from C is to simply use fgets() to enter the name. So you
PH>could rewrite the first program thusly:
You could use cin.get - it reads all characters including whitespace
up to either however many characters you tell it to read, or
until it reaches an end of line marker.
cin.get(myChar[x], 21);
This will either read in 21 characters and then stop, or read up to the
end of line marker if there are less than 21 characters.
-=- John -=-
---
 þ OLXWin 1.00b þ INTERNET: jparker@tir.com
--- KING'S DOMAIN
---------------
* Origin: Sterling Hgts., MI * Where Good Friends Meet * (1:120/481)

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™.