TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: NEIL HELLER
from: WILLIAM MCBRINE
date: 1998-02-06 09:16:00
subject: C++ SAVEDING STUFF

-=> Neil Heller wrote to Manish Malik <=-
 NH> MM> char *s;
 NH> MM> gets(s);
 NH> That's going from bad to worse.  You've only allocated two bytes (in a
 NH> 16-bit system or 4 bytes in a 32-bit system) to hold what the user
 NH> types.  That's guaranteed to tromp on somebody's memory.
Actually he's allocated 0 bytes for it! since gets() takes a pointer, and 
s was defined as a char pointer. If he used "gets(&s)", then at least 
he'd have the 2 or 4 bytes. ;-)
... My hard disk is full! Maybe I'll try this message section thing.
---
1:109/570)
---------------
* Origin: * My Place BBS * Bowie, Md USA * V.34 * (301)805-1602 *

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