Scroll Down to See All
abortabsacosasctimeasctime_rasinassertatanatan2atexitatofatoiatolbsearchbtowccalloccatclosecatgetscatopenceilclearerrclockcoscoshctimectime_rdifftimediverferfcexitexpfabsfclosefdopenfeofferrorfflushfgetcfgetposfgetsfgetwcfgetwsfopenfprintffputcfputwsfreadfreefreopenfrexpfscanffseekfsetposftellfwidefwprintffwritefwscanfgetcgetchargetenvgetwcgetwchargmtimegmtime_rhypotisalnumisalphaisasciiisblankiscntrlisdigitisgraphislowerisprintispunctisspaceisupperiswalnumiswalphaiswblankiswcntrliswctypeiswdigitiswgraphiswloweriswprintiswpunctiswspaceiswupperiswxdigitisxdigitj0j1jnlabsldexpldivlocaleconvlocaltimelocaltime_rloglog10longjmpmallocmblenmbrlenmbrtowcmbsinitmbsrtowcsmbstowcsmbtowcmemchrmemcmpmemcpymemmovememsetmktimemodfnextafternextafterlnexttowardnexttowardlnl_langinfoperrorpowprintfputcputcharputenvputsputwcputwcharqsortquantexpd32quantexpd64quantexpd128quantized32quantized64quantized128samequantumd32raiserandrand_rreallocregcompregerrorregexecregfreeremoverenamerewindscanfsetbufsetjmpsetlocalesetvbufsignalsinsinhsnprintfsprintfsqrtsrandsscanfstrcasecmpstrcatstrchrstrcmpstrcollstrcpystrcspnstrerrorstrfmonstrftimestrlenstrncasecmpstrncatstrncmpstrncpystrpbrkstrptimestrrchrstrspnstrstrstrtodstrtod32strtod64strtod128strtofstrtokstrtok_rstrtolstrtoldstrtoulstrxfrmswprintfsystemtantanhtimetime64tmpfiletmpnamtoasciitolowertouppertowctranstowlowertowupperungetcungetwcva_argva_copyva_endva_startvfprintfvfscanfvfwprintfvfwscanfvprintfvscanfvsprintfvsnprintfvsscanfvswprintfvswscanfvwprintfvwscanfwcrtombwcscatwcschrwcscmpwcscollwcscpywcscpywcsftimewcslenwcsncatwcsncmpwcsncpywcspbrkwcsptimewcsrchrwcsrtombswcsspnwcsstrwcstodwcstod32wcstod64wcstod128wcstofwcstokwcstolwcstoldwcstombswcstoulwcsxfrmwctobwctombwctranswctypewcwidthwmemchrwmemcmpwmemcpywmemmovewmemsetwprintfwscanfy0y1yn



Function Details : swscanf

intswscanf(const wchar_t * ws,const wchar_t * format,... args) ;

Return Type : int

Integer type (typically 4 bytes, -2,147,483,648 to 2,147,483,647)
Read about return values of swscanf function .

1st Parameter Type : const wchar_t *

A pointer to a read-only wide-character string, where each character is of type `wchar_t`. Used for representing text in wide-character encoding to support extended character sets, such as Unicode. The string is null-terminated, with the terminator being a `wchar_t` with value 0.

1st Parameter

Pointer to the null-terminated wide-character string to be read and parsed.

2nd Parameter Type : const wchar_t *

A pointer to a read-only wide-character string, where each character is of type `wchar_t`. Used for representing text in wide-character encoding to support extended character sets, such as Unicode. The string is null-terminated, with the terminator being a `wchar_t` with value 0.

2nd Parameter

Pointer to a null-terminated wide-character string specifying the format to be matched. It can include format specifiers like `%d`, `%ls`, etc.

3rd Parameter Type : ...

Represents a variable number of arguments in a function. Used in functions like `printf` or `fprintf` to accept additional parameters beyond those explicitly declared.

3rd Parameter

Pointers to variables where the parsed values will be stored. Each pointer corresponds to a format specifier in the `format` string.

Read more about parameters of swscanf in parameters section
The swscanffunction in C language Reads formatted input from a wide character string.
The swscanf function is the wide-character equivalent of sscanf. It reads formatted input from a wide string, interprets it according to the format string, and stores the results in the locations given by the additional arguments. This function is particularly useful for parsing wide character strings in internationalized applications.
The swscanffunction takes 3 parameters:
  • const wchar_t * `ws`: Pointer to the null-terminated wide-character string to be read and parsed.
  • const wchar_t * `format`: Pointer to a null-terminated wide-character string specifying the format to be matched. It can include format specifiers like `%d`, `%ls`, etc.
  • ... `args`: Pointers to variables where the parsed values will be stored. Each pointer corresponds to a format specifier in the `format` string.
Reads formatted input from the wide-character string `ws` based on the format string `format` and stores the extracted values in the provided variables. Returns the number of input items successfully matched and assigned, or `EOF` if an error occurs or the end of the string is reached before any matches.
The swscanf function return value :
  • Returns the number of input items successfully matched and assigned
  • Returns EOF if an error occurred before any conversion

Output

This example demonstrates basic usage of swscanf to parse a wide string containing a name, age, and height.