Results 1 to 6 of 6
Hi All,
I have a problem with wstring, maybe someone had similar problem.
When I trying to create wstring object:
std::wstring testString(L"Simple string");
created object testString have invalid length, i.e. ...
- 09-30-2009 #1Just Joined!
- Join Date
- Sep 2009
- Posts
- 6
[SOLVED] std::wstring problem in simple program
Hi All,
I have a problem with wstring, maybe someone had similar problem.
When I trying to create wstring object:
created object testString have invalid length, i.e. when I get length after creating object:std::wstring testString(L"Simple string");it returns some dummy number (thousands, millions). I programming under Ubuntu, and my gcc version is 4.3.3.testString.length()
I'm new in Linux programming. I know that it is need to post code to the forum when asking the question, but the problem is so simple, that it is nothing to post, just main function, and object of wstring type.
It is interesting that with std::string object everything is ok. Even if I create wstring object with empty stringobject also have invalid length, emptyString.clear() - also doesn't help.std::wstring emptyString(L"")
I will be very thankful for any help in this issue.
P.S. sorry for grammatical and syntax errors, English is not my native language.
- 10-01-2009 #2Just Joined!
- Join Date
- Sep 2009
- Posts
- 6
Thanks to all, question closed!
- 10-01-2009 #3Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
So, what was your solution?
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 10-01-2009 #4Just Joined!
- Join Date
- Sep 2009
- Posts
- 6
It was very stupid thing...
I use NetBeans, and it is possible to watch expressions like: "someString.length()" in Watch window in process of debug, and you get some value, but actually it shows pointer on function in decimal form, but not value returned by this function...
Yes, I know, I stupid...
Anyway, thank you for your help and your time.
- 10-01-2009 #5
- 10-01-2009 #6Just Joined!
- Join Date
- Sep 2009
- Posts
- 6
yea... I thought NetBeans will display "Invalid watch expression" or something like that... But pointer to function in decimal form, without any hints, it's cruel
, but, anyway it's my fault.
Thank you



