int swscanf(const wchar_t* kwpBuffer,
const wchar_t* kwpFormatString, ...);#include <cwchar>
int main()
{
const wchar_t kwaBuffer[] = L"XoaX.net 87";
wchar_t waString[11];
int iInteger = 0;
// Read a string of max size 10 and then an integer
int iSize = swscanf(kwaBuffer, L"%10ws %d", waString, &iInteger);
wprintf(L"String = %ws\n", waString);
wprintf(L"int = %d\n", iInteger);
wprintf(L"%d arguments read.\n", iSize);
// Keep the window open until "Enter" is pressed
getwchar();
return 0;
}
© 20072025 XoaX.net LLC. All rights reserved.