|
|
implementing string class using std namespace string
|
|
12/11/2009 7:38 AM
post43613
|
implementing string class using std namespace string
Hi,
I made a string class for wide characters.
this is the code -
using namespace std;
class MyString
{
public:
wstring wStr;
MyString () {wStr = L"";}
MyString (wstring str) {wStr = str;}
};
int main()
{
wstring firstName = L"Vipul";
MyString myStr (firstName);
wprintf(L"%s", myStr.wStr);
return 0;
}
But it gives error - cannot pass objects of non-POD type class std::wstring through '...'; call will abort at runtime.
What are POD type classes and non-POD type classes?
And how to solve this? I want to make my string class platform independent.
Thanks,
|
|
|
|
|