- Joined
- Sep 18, 2009
- Messages
- 2
- Reaction score
- 0
Hi Everybody,
I need to convert _TCHAR to char. Trying to run:
but it gives me the error:
Any suggestions?:captain:
All comments are welcome.:beer:
I need to convert _TCHAR to char. Trying to run:
Code:
// winXP; MSVC++2008Pro
int _tmain(int argc, _TCHAR* argv[])
{...
// convert _TCHAR* argv[] to char
wstring s = argv;
//convert from wchar to char
const wchar_t* wstr = s.c_str();
size_t wlen = wcslen(wstr) + 1;
char newchar[100];
size_t convertedChars = 0;
wcstombs_s(&convertedChars, newchar, wlen, wstr, _TRUNCATE);
error = NotesInitExtended(argc, newchar);
....
}
Code:
error C2440: 'initializing' : cannot convert from '_TCHAR *[]' to 'std::basic_string<_Elem,_Traits,_Ax>'
All comments are welcome.:beer: