Platform independant? This problem is not related to platform at all its related to C++ standard. There isnt enough code to tell. POD means plain old data. That means wprintf expect a pointer or a variable but think that wstring is not, it`s probably an object.
Didn’t know about wstring, they are basic_string with a type wchar_t. So it all make sense to me now As time said you need to use str.c_str(). That being said that won’t work either because you need to use wprintf and not printf.
Why don’t you use std::cout << myString.wStr();
Or even better provide a << operator so you could do std::cout << myString << …
This works in windows, gives perfect result.
But in QNX it is giving only first character ‘V’ in the result.
I want to make it work on both. What do I need to change?
This line is illegal. Read the documentation on c_str()
Maybe you have futur plan for this class, but at this time its totally useless. If you come from a Windows background the MFC CString::Format() method was nice because you didnt have to care about buffer size, but your Format method doesnt provide that feature since its going though a fixed size buffer. For a C++ programmer you class is misleading. Why write a class if c_str() is used all over the place.
Also cout<<myStr.wStr.c_str()<<endl; should be cout<<myStr.wStr <<endl;