TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: WADE CARPENTER
from: TOM TORFS
date: 1997-07-31 17:22:00
subject: How would I...

Wade Carpenter wrote in a message to All:
 WC> I'm using Tc++ v.3 in dos, and I'm trying to read 
 WC> a directory name, like "C:\WINDOWS\SYSTEM" for example,
 WC> using gets(dirw).
Don't use gets, use fgets instead - it allows you to define a maximum string 
length (but you'll have to strip the newline yourself).
Make sure your string is properly defined:
char s[80];
or
char *s;
s = malloc(256);
if (s==NULL)
   return 1;
 
or something with new s[] or whatever, but you'll have to ask someone who 
programs in C++ for the details :-)
greetz,
Tom
tomtorfs@mail.dma.be
--- timEd/2 1.10+
---------------
* Origin: 80X86 BBS 32-15-24.62.32 V.34/V.FC (24h/24h) (2:292/516)

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