-
February 5th, 2013, 03:55 AM
#1
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
-
February 5th, 2013, 05:54 AM
#2
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.
-
February 5th, 2013, 06:23 AM
#3
Re: Quick question on const char[] to wstring
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|