Quick question on const char[] to wstring
Hello,
I am wondering if I have the following parameter to pass in to a function
Code:
void Load(std::wstring filename);
This statement is wrong.
Code:
Load("Data\\Mesh.x");
I don't want to pre-declare a variable. How do I directly pass a wstring (literal) to this function.
Sorry, Don't know if this is specific to Visual C++ where I am using
Thanks
Jack
Re: Quick question on const char[] to wstring
Code:
Load(L"Data\\Mesh.x");
Also, if you do not change filename, you should pass by const reference, not by value.
Re: Quick question on const char[] to wstring