How to convert stringc to stringw ?
-
- Posts: 41
- Joined: Mon Feb 11, 2008 3:06 pm
You must use c_str() function to exporting stringc to stringw or stringw to stringc...
Example:
Example:
Code: Select all
#include <irrlicht.h>
#include <iostream>
using namespace irr;
#pragma comment(lib,"irrlicht.lib")
int main()
{
core::stringw str2=L"TEST";
core::stringc str;
str=str2.c_str();
std::cout<<str.c_str();
}
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
You coul have helped yourself pretty easily by using the search button. That's why I replied only with my warning, which you should take into considerations, though. Because you cannot rely on proper transformation of characters outside the basic ASCII set using this method. All other characters require calls to basic C functions which the search should also come up with, Acki often posts about these methods).
-
- Posts: 8
- Joined: Wed Mar 19, 2008 12:03 pm
it finally makes sense thanks!
I'm working on a game, taking baby steps of course right now just working on the chat box. I could not get the text to show from the client to the server and when I finally got the irrnetbeta stuff working, it would crash the server when i sent the wrong kind of string.
I'm working on a game, taking baby steps of course right now just working on the chat box. I could not get the text to show from the client to the server and when I finally got the irrnetbeta stuff working, it would crash the server when i sent the wrong kind of string.