TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: DARIN MCBRIDE
from: ROGER SCUDDER
date: 1998-03-24 15:24:00
subject: Re: I`m an idiot

Hello Darin.
22 Mar 98 14:59, Darin McBride wrote to Tim Hutzler:
TH>> Use the following code:
TH>> char name[15];
TH>> gets(name,15); //"name" is the string, "15" is the maximum number of 
chars
DM> Um.... what compiler do you use that has "gets(char*, int)"?
 I feel your pain.  Man, it would drive me nuts having to read all
 these posts from guys who keep telling people to use crappy C
 functions when they should be using the C++ iostreams.
 Wouldn't a good way to handle the above be to use the sizeof operator?
 cin.getline( name, sizeof( name ));
 
 -Roger
... I don't suffer from insanity, I enjoy every minute of it.
--- Msged 4.20 beta 3
(1:273/404@fidonet)
---------------
* Origin: Hodge-Podge Support BBS, Upper Darby, Pennsylvania, USA

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