TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: WADE CARPENTER
from: KEVIN CAMPBELL
date: 1997-07-26 13:40:00
subject: How would I...

 > I'm pretty much stumped right now...
 > I'm using Tc++ v.3 in dos, and I'm trying to read
 > a directory name, like "C:\WINDOWS\SYSTEM" for example,
 > using gets(dirw).
Not too sure what you're doing here, gets() reads info from a file, and 
doesn't give you directory information. Please explain.
 > When I enter a directory, it messes it all up and all my
 > char strings get mixed together, like for example my
 > dir2 string will get the end characters of "C:\WINDOWS\SYSTEM"
 > and other strings just plain disappear.  This baffles me..
Check there isn't another bug in your code. You could have a wild pointer 
that's overwriting memory everywhere, and messing up the heap.
 > Now, what I tried to do was to enter double \\, like must be
 > done with printf(), but that didn't help.. (You know, like
 > printf("C:\DOS"); prints C:DOS and printf("C:\\DOS"); gives the truth...
The \\ is nothing to do with printf(), but to do with C++. C++ uses \ as a 
control character, so you have combinations such as \n for a newline, and \r 
for a carraige return. You need to double up on the \ to avoid ambiguity.
Have Fun - Kev
Kevin Campbell
Sysop of Deimos BBS
E-Mail: Sysop@Deimos.unmanned.co.uk
--- FMail/386 1.02
---------------
* Origin: Mail shipped from Deimos Spaceport (2:258/8)

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