c++ convert const char* to char* code example
Example 1: c++ convert const char* to int
#include <iostream>
#include <sstream>
const char* value = "1234567";
stringstream strValue;
strValue << value;
unsigned int intValue;
strValue >> intValue;
cout << value << endl;
cout << intValue << endl;
Example 2: c++ convert const char* to LPCWSTR
const char *p = "D:\\";
const WCHAR *pwcsName;
int size = MultiByteToWideChar(CP_ACP, 0, p, -1, NULL, 0);
pwcsName = new WCHAR[nChars];
MultiByteToWideChar(CP_ACP, 0, p, -1, (LPWSTR)pwcsName, size);
delete [] pwcsName;
}