www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/12/12/21:43:31

Newsgroups: comp.os.msdos.djgpp
From: Bill Campbell <wjcampbe AT bechtel DOT com>
Subject: Re: what about the "\"
To: Ole Winther <owsim AT emma DOT ruc DOT dk>
Message-ID: <32B08EE5.3935@bechtel.com>
Sender: news AT bechtel DOT com (USENET News System)
Reply-To: wjcampbe AT bechtel DOT com
Organization: bechtel.com
References: <9612111400 DOT AA05959 AT emma DOT ruc DOT dk>
Mime-Version: 1.0
Date: Thu, 12 Dec 1996 23:01:57 GMT
Lines: 24
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Ole Winther wrote:
> 
> Well some small problems
> 
> I where trying this.
> 
> char* str;
> str = new char[5];
> strcpy( str, "C:\PT" );
> 
> and printing this gives ( C:PT  ), the "\" is stripped. when compiling the
> programs there complains about and unknown escape char. How to do it?
> 
> Ole Winther

Should this not be :
	strcpy( str, "C:\\PT"
since the single \ is read as \p (Escape p)

-- 
Bill C 	15 years of dBASE, One month of C, 42 years of life.....
			"In pursuit of Knowledge"		
100610 DOT 3526 AT Compuserve DOT com			wjcampbe AT bechtel DOT com
Opinions expressed are personal and are not Bechtel opinion or policy.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019