TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: JASON LAVOIE
from: HERBERT BUSHONG
date: 1997-09-21 03:57:00
subject: string input

::> for some reason I can't seem to input a string with spaces in it.
::> am I missing something?
::> like:
::> char testvar[100];
::> cin >> testvar;
::> how come I only get the first word?
cin only reads up to the first white-space character.
try:
cin.getline(testvar, 99, '\n');
That will read up to 99 characters from cin, into testvar, stopping when the
enter key is pressed.
#  Herbert Bushong    harchon@centuryinter.net       [TEAM OS/2]    
-  Blackbeard's BBS   Intelec: 239:600/0            
+  Fido: 1:19/19      http://www.intelec.com/software/
---
   RM 1.31 2508   Let the meek inherit the Earth, I want the stars!
---------------
* Origin: Blackbeard's BBS - Ville Platte, LA - 318-468-3385 (1:19/19)

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