I want to convert a wstring to unsigned long long.
I am trying it like this:
ret.push_back(_wtol(s1));
The compiler throws this error:
No conversion available for "std::wstring" to const "wchar_t *"
This is the entire code:
vector<unsigned long long> splitW2(const wstring& uMain, const wstring& uSplitBy)
{
vector<unsigned long long>ret;
int iStart = 0;
for (;;)
{
int iPos = uMain.find(uSplitBy, iStart);
if (iPos == -1)
{
wstring s1;
s1 = uMain.substr(iStart, uMain.size() - iStart);
if (s1.size() > 0)
{
ret.push_back(_wtol(s1));//the error here is: There is conversion available for "std::wstring" to const "wchar_t *"
}
break;
}
else
{
wstring s2;
s2 = uMain.substr(iStart, iPos - iStart);
ret.push_back(s2);//this of course is also not possible.
iStart = iPos + 1;
}
}
return ret;
}