delorie.com/archives/browse.cgi | search |
From: | eglebbk AT phys DOT uva DOT nl (Evert Glebbeek) |
Newsgroups: | comp.os.msdos.djgpp |
Subject: | Re: Newbie question about strings in C .. |
Date: | Wed, 05 Jul 2000 16:14:12 GMT |
Organization: | Physics student, University of Amsterdam |
Lines: | 22 |
Distribution: | world |
Message-ID: | <39635d7a.1931139@news.wins.uva.nl> |
References: | <396119a7 DOT 31315113 AT news> <396230e0 DOT 2867154 AT news DOT wins DOT uva DOT nl> <3962e6ff DOT 1845350 AT news DOT freeserve DOT net> |
NNTP-Posting-Host: | stol-117-226.uva.studentennet.nl |
X-Trace: | info.wins.uva.nl 962813584 3427 145.98.117.226 (5 Jul 2000 16:13:04 GMT) |
X-Complaints-To: | usenet AT science DOT uva DOT nl |
NNTP-Posting-Date: | Wed, 5 Jul 2000 16:13:04 +0000 (UTC) |
X-Newsreader: | Forte Free Agent 1.11/32.235 |
To: | djgpp AT delorie DOT com |
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
Reply-To: | djgpp AT delorie DOT com |
Newsgroup: comp.os.msdos.djgpp From: dontmailme AT iname DOT com (Steamer) On Wed, 05 Jul 2000 07:43:15 GMT <snip> >> I usually deal with this by simply setting the string size >> redicilously large so it will never be overwritten in normal useage > >But what about abnormal usage? I use one global string (called something like inbuf) for all my input. I figure that one too-large-string-by-a-few-hundred-bytes isn't going to cause my program to run out of memory. > >> (eg, a 256 byte string when reading a 2 digit number). > >So why not use fgets(buffer,256,stdin)? Never used fgets(), so I never thought of it :) Anyway, I'll use fgets() next time I want to write an input routine. Thanks! Evert Glebbeek
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |