By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,908 Members | 1,364 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,908 IT Pros & Developers. It's quick & easy.

wchar_t and wstring with -fshort-wchar optinon with g++.

P: n/a
Hi
I have one problem. I compiled my program with -fshort-wchar
option using g++. In my program I am using wstring also. In some places
I converted the wchar_t variable to wstring .
wstring str;
const wchar_t* Root=L"One";
const wchar_t* Node=L"Point No";
if (Root){
str.append(1, '.') += Root;
}
str.append(Node);
at the end of the function ,
I want a string in str like "Point No . One".
But in my case the str contains a string like "Point No \0 . One".
Anyone one can suggest a way to do it .What is the problem...? I am
using Solaris SPARC & g++ 3.4.2.
Thanks & Regards
--Vinu

Aug 4 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

Vinu schreef:
Hi

wstring str;
const wchar_t* Root=L"One";
const wchar_t* Node=L"Point No";
if (Root){
str.append(1, '.') += Root;
}
str.append(Node);

I want a string in str like "Point No . One".


a wchar_t literal is also prefixed with :, like L'.'

HTH,
Michiel Salters

Aug 4 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.