C examples for wchar.h:swscanf
function
<cwchar> <wchar.h>
Read formatted data from string
int swscanf (const wchar_t* ws, const wchar_t* format, ...);
Parameter | Description |
---|---|
ws | C wide string that the function processes as its source to retrieve the data. |
format | a scanf format string |
On success, the function returns the number of items in the argument list filled.
On error, EOF is returned.
#include <wchar.h> int main ()/*from www . j av a 2 s .c o m*/ { wchar_t sentence [] = L"this is a test 10 123"; wchar_t str [20]; int i; swscanf (sentence,L"%ls %*s %d",str,&i); wprintf (L"%ls -> %d\n",str,i); return 0; }