TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: MANISH MALIK
from: FRANK ADAM
date: 1998-02-04 23:09:00
subject: C++ Saveding stuff

On Jan 31 22:36, 1998, Manish Malik of 6:606/26 wrote:
G'day Manish,
AT>> NO!  Never!  Bad!    You've allocated 40 bytes,
AT>> but the user could easily type 4000.
MM> okay, hows this piece of code ??
MM> char *s;
MM> gets(s);
MM> puts("\r\n Whether you typed 40 or 4000, I have it all ! Here - ");
MM> puts(s);
MM> Okay now ? :-)
Put out the other hand, what makes you think you will get to puts(s) ? ;-) 
s needs to be allocated.
 Regards, Frank.   Email: fadam@sensation.net.au. 
--- Msged 4.20 beta 4
---------------
* Origin: The ticking point, Melbourne, Australia. (3:635/728.21@fidonet)

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