niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Programming » C
String macro as wchar_t pointer?
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
Author Message
Heiner
*nix forums beginner


Joined: 21 Aug 2005
Posts: 13

PostPosted: Fri Jun 23, 2006 9:32 pm    Post subject: Re: String macro as wchar_t pointer? Reply with quote

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

PostPosted: Fri Jun 23, 2006 9:18 pm    Post subject: Re: String macro as wchar_t pointer? Reply with quote

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

PostPosted: Fri Jun 23, 2006 9:11 pm    Post subject: String macro as wchar_t pointer? Reply with 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?


Heiner
h.eichmann@nospam.gmx.de
Remove the nospam to get my real address
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
The time now is Fri Nov 21, 2008 6:57 am | All times are GMT
navigation Forum index » Programming » C
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Function Pointer Sikandar C 3 Fri Jul 21, 2006 1:23 pm
No new posts FAQ 4.32 How do I strip blank space from the beginning/en... PerlFAQ Server Perl 0 Fri Jul 21, 2006 1:03 pm
No new posts FAQ 4.34 How do I extract selected columns from a string? PerlFAQ Server Perl 0 Fri Jul 21, 2006 7:03 am
No new posts determine pointer to point to array or single item during... yancheng.cheok@gmail.com C++ 5 Fri Jul 21, 2006 1:17 am
No new posts print all permutations of string anurag C 10 Thu Jul 20, 2006 5:57 pm

Property Search | Cingular Ringtones | Website Design | Mortgage Calculator | Debt
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1931s ][ Queries: 20 (0.1244s) ][ GZIP on - Debug on ]