From: "A. Sinan Unur" Newsgroups: comp.os.msdos.djgpp Subject: Re: what about the "\" Date: Thu, 12 Dec 1996 12:36:24 -0500 Organization: Cornell University http://www.cornell.edu Lines: 26 Sender: asu1 AT cornell DOT edu (Verified) Message-ID: <32B04298.50A9@cornell.edu> References: <9612111400 DOT AA05959 AT emma DOT ruc DOT dk> Reply-To: asu1 AT cornell DOT edu NNTP-Posting-Host: cu-dialup-0014.cit.cornell.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: Ole Winther 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? several other people have indicated the solution to your direct question. however, there is another problem with this code. you str does not have enough room to contain both "C:\\PT" and the end of string marker '\0'. -- ******************************************************************* A. Sinan Unur WWWWWW |--O+O mailto:asu1 AT cornell DOT edu C ^ mailto:sinan AT econ DOT cit DOT cornell DOT edu \ ~/ http://www.bqnet.com/sinan/ *******************************************************************