wchar to char in c++
- by Chris
I have a Windows CE console application that's entry point looks like this
int _tmain(int argc, _TCHAR* argv[])
I want to check the contents of argv[1] for "-s" convert argv[2] into an integer. I am having trouble narrowing the arguments or accessing them to test.
I initially tried the following with little success
if (argv[1] == L"-s")
I also tried using the narrow function of wostringstream on each character but this crashed the application.
Can anyone shed some light?
Thanks