Newsgroups: comp.os.msdos.djgpp From: Bill Campbell Subject: Re: what about the "\" Content-Type: text/plain; charset=us-ascii To: Ole Winther Message-ID: <32B08EE5.3935@bechtel.com> Sender: news AT bechtel DOT com (USENET News System) Reply-To: wjcampbe AT bechtel DOT com Content-Transfer-Encoding: 7bit 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.