converting const wchar_t * to const char * and more

A forum to store posts deemed exceptionally wise and useful
Post Reply
kompromis
Posts: 98
Joined: Mon Sep 11, 2006 2:36 pm
Location: sweden/stockholm

converting const wchar_t * to const char * and more

Post by kompromis »

how to convert:
const wchar_t * to const char *

Code: Select all

irr::core::stringc tempryc = (const wchar_t * value);
const char * converted = stringc.c_str()
how to convert:
const char * to const wchar_t *

Code: Select all

irr::core::stringw tempryw = (my char)
const wchar_t * converted = tempryw.c_str();
how to convert:
const char* to char*

Code: Select all

char* username=const_cast<char*>(tempryc.c_str());
Last edited by kompromis on Fri Mar 23, 2007 1:41 pm, edited 1 time in total.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Code: Select all

irr::core::stringc tempryc =tempryc =(const wchar_t * value);
const char * converted = stringc.c_str()
should read

Code: Select all

irr::core::stringc tempryc  = (const wchar_t * value);
const char * converted = tempryc.c_str()
Post Reply