| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | C++ Saveding stuff |
MM> words.
MM> e.g.
MM> char s[40];
MM> gets(s);
MM> puts("\r\nThis was the string you entered : "); puts(s);
NO! Never! Bad! You've allocated 40 bytes, but the user
could easily type 4000.
use:
char s[40];
fgets (s, 40, stdin);
printf ("\n\nThis was the string you entered: %s\n", s);
--- PointEd 2.0
---------------
* Origin: The Tibbs' Point - Ottawa, Ontario, Canada (1:163/215.38) |
|
| 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™.