TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: TIM HUTZLER
from: DARIN MCBRIDE
date: 1998-03-22 14:59:00
subject: Re: I`m an idiot

-=>Quoting Phil Ohl to All <=-
PO>char name[20];
PO>cout<<"Enter name: ";
PO>getline(name, cin);
PO>It just wont work.  How would I remedy this problem without limiting
PO>the user to just their first or last name.
 TH> Use the following code:
 TH> char name[15];
 TH> gets(name,15); //"name" is the string, "15" is the maximum number of 
chars
Um.... what compiler do you use that has "gets(char*, int)"?
You need to go to fgets to specify length.
---
---------------
* Origin: Tanktalus' Tower BBS (1:250/102)

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