www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/12/14/20:24:57

From: cdamond AT uclink2 DOT berkeley DOT edu
Newsgroups: comp.os.msdos.djgpp
Subject: Re: what about the "\"
Date: 14 Dec 1996 07:21:57 GMT
Organization: University of California, Berkeley
Lines: 40
Message-ID: <58tkil$9aa@agate.berkeley.edu>
NNTP-Posting-Host: beshaba.hip.berkeley.edu
Originator: lucifer AT agate DOT berkeley DOT edu
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

>
>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?
>


This is really a newbie C question, not djgpp question, but the answer is:

strcpy(str, "C:\\PT");



























- Raw text -


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