Re: string of ascii chars?
From: Heinz Ozwirk (wansor42_at_gmx.de)
Date: 07/15/04
- Next message: tom_usenet: "Re: Question about static functions"
- Previous message: Scott McPhillips [MVP]: "Re: Why CMainFrame can't accept WM_COPYDATA?"
- In reply to: Andru: "string of ascii chars?"
- Next in thread: Andru: "Re: string of ascii chars?"
- Reply: Andru: "Re: string of ascii chars?"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 15 Jul 2004 13:02:09 +0200
"Andru" <andru123 at hotmail dot com> schrieb im Newsbeitrag news:uLXQy8kaEHA.712@TK2MSFTNGP11.phx.gbl...
> Hi,
>
> I'd like to specify the string of ASCII chars, codes of which I know.
>
> CString str = "\13" + "\10" + "\25";
>
> ^^
> does not work :(
You cannot add pointers.
>
> Neither works
> CString str = _T("\13\10\25");
>
> What are the possible and preferred ways to do that?
Do what? The last line of code does work and initializes str with a string of characters 0x0B, 0x08 and 0x15. Numbers following \ in a string or char literal are octal. If you want a string starting with carriage return and linefeed you should write "\x0D\x0A..." or "\15\12..." or "\r\n...".
HTH
Heinz
- Next message: tom_usenet: "Re: Question about static functions"
- Previous message: Scott McPhillips [MVP]: "Re: Why CMainFrame can't accept WM_COPYDATA?"
- In reply to: Andru: "string of ascii chars?"
- Next in thread: Andru: "Re: string of ascii chars?"
- Reply: Andru: "Re: string of ascii chars?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|