I've been trying to figure out how to convert a c string that uses a char pointer to a wide c string that uses a wchar_t pointer. I can't figure out what function that I can use to do this. I looked on MSDN and the only remotely helpful thing I found was MultibyteToWideChar but from what I saw it can be dangerous to use if you don't know what your doing, aka me trying to use it.Anybody have a better suggestion?
Warnings are warnings. You can ignore them if you understand them.
In the example, the warning is about assigning things of different sizes. You can ignore it because that's the whole point of the call. Moving from one size to another.
And a warning is a lot better than using non-standard functions.
When I tried to compile with the exact preprocessor you gave me the warning persisted. I looked at the warning and it gave me 4996 as the warning code for the copy function. I disabled 4996 and the warning went away. I'm using VS C++ 2008 if it makes a difference.
Oh, that's just for C. It'll be some time until they get added to C++, if they ever are. They're definitely not going to be included in C++0x, so it'll probably be at least another ten years.
OK, Most of the functions with a '_' in their name aren't standard.
Is everybody happy now?
BTW, c_str can be said as a 'method' I meant global functions