long wcstol(const wchar_t* kwpString, wchar_t** wppEndPtr, int iBase);
#include <cwchar>
int main()
{
const wchar_t kwaWideString[] = L"101 XoaX.net";
const wchar_t* kwpWidePtr = kwaWideString;
// Convert the string to a decimal value
long lConvert = wcstol(kwaWideString, NULL, 10);
wprintf(L"Decimal Value %d\n", lConvert);
wprintf(L"Original String: %ws\n", kwaWideString);
// Convert the string to a binary value
lConvert = wcstol(kwaWideString, NULL, 2);
wprintf(L"Binary Value %d\n", lConvert);
wprintf(L"Original String: %ws\n", kwaWideString);
// Keep the window open until "Enter" is pressed
getwchar();
return 0;
}
© 20072026 XoaX.net LLC. All rights reserved.