On 31-Jan-98, Manish Malik wrote to Anthony Tibbs about C++ Saveding stuff.
MM>>> char s[40]; gets(s); puts("\r\nThis was the string you entered :
MM>>> "); puts(s);
AT>> NO! Never! Bad! You've allocated 40 bytes, but
AT>> the user could easily type 4000.
MM> okay, hows this piece of code ?? char *s; gets(s); puts("\r\n
MM> Whether you typed 40 or 4000, I have it all ! Here - "); puts(s);
WORSE!!! Your "new" method can't even take one character, as s points to
nooneknowswhere...
Hint: fgets should be nice to look up at the help.
Javier Kohen >jkohen@tough.com< [The_Crusher] http://jkohen.base.org
+4:900/748.3+ _200:201/126_ ICQ:#3855350# PGPID:*3423EAA9*
.!. Let's start a war... (said Maggie one day) * The Exploited
--- Terminate 5.00/Pro
---------------
* Origin: The King of The Ring (4:900/748.3)
|