unsigned long wcstoul(const wchar_t* kwpString, wchar_t** wppEndPtr, int iBase);
#include <cwchar> int main() { wchar_t waString[] = L"101XoaX.net"; wchar_t* wpEndPtr; // Convert the digits in decimal and set the end pointer unsigned long ulConversion = wcstoul(waString, &wpEndPtr, 10); wprintf(L"Convert the string \"%ws\" up to \"%ws\" in decimal\n", waString, wpEndPtr); wprintf(L"The result is %d\n", ulConversion); // Convert the digits in binary and set the end pointer ulConversion = wcstoul(waString, &wpEndPtr, 2); wprintf(L"Convert the string \"%ws\" up to \"%ws\" in binary\n", waString, wpEndPtr); wprintf(L"The result is %d\n", ulConversion); // Keep the window open until "Enter" is pressed getwchar(); return 0; }
© 20072024 XoaX.net LLC. All rights reserved.