| Author |
Message |
Heiner *nix forums beginner
Joined: 21 Aug 2005
Posts: 13
|
Posted: Fri Jun 23, 2006 9:32 pm Post subject:
Re: String macro as wchar_t pointer?
|
|
|
On Fri, 23 Jun 2006 18:18:50 -0400, Eric Sosman wrote:
| Quote: | const wchar_t * wtest = L"" TEST;
... taking advantage of string literal concatenation:
When a wide-string literal L"" is concatenated with a
char-string literal, the result is wide.
|
That's it. Thank you very much!
Heiner |
|
| Back to top |
|
 |
Eric Sosman *nix forums Guru
Joined: 21 Feb 2005
Posts: 1246
|
Posted: Fri Jun 23, 2006 9:18 pm Post subject:
Re: String macro as wchar_t pointer?
|
|
|
Heiner wrote On 06/23/06 17:15,:
| Quote: | Hi!
#define TEST "this is a test"
const char * test = TEST;
const wchar_t * wtest = ???;
What must I write, to get TEST evaluated to L"this is a test" at compile
time?
|
const wchar_t * wtest = L"" TEST;
.... taking advantage of string literal concatenation:
When a wide-string literal L"" is concatenated with a
char-string literal, the result is wide.
--
Eric.Sosman@sun.com |
|
| Back to top |
|
 |
Heiner *nix forums beginner
Joined: 21 Aug 2005
Posts: 13
|
Posted: Fri Jun 23, 2006 9:11 pm Post subject:
String macro as wchar_t pointer?
|
|
|
Hi!
#define TEST "this is a test"
const char * test = TEST;
const wchar_t * wtest = ???;
What must I write, to get TEST evaluated to L"this is a test" at compile
time?
Heiner
h.eichmann@nospam.gmx.de
Remove the nospam to get my real address |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|