ConvertDataTypes.comConvert data types programming in one click !

Convert char* to wchar_t* in C

    40568 hits
  • char * vIn = "FOO";
  • wchar_t * vOut = new wchar_t[strlen(vIn)+1];
  • mbstowcs_s(NULL,vOut,strlen(vIn)+1,vIn,strlen(vIn));