Scroll Down to See All
abortabsacosasctimeasctime_rasinassertatanatan2atexitatofatoiatolbsearchbtowccalloccatclosecatgetscatopenceilclearerrclockcoscoshctimectime_rdifftimediverferfcexitexpfabsfclosefdopenfeofferrorfflushfgetcfgetposfgetsfgetwcfgetwsfopenfprintffputcfputwsfreadfreefreopenfrexpfscanffseekfsetposftellfwidefwprintffwritefwscanfgetcgetchargetenvgetwcgetwchargmtimegmtime_rhypotisalnumisalphaisasciiisblankiscntrlisdigitisgraphislowerisprintispunctisspaceisupperiswalnumiswalphaiswblankiswcntrliswctypeiswdigitiswgraphiswloweriswprintiswpunctiswspaceiswupperiswxdigitisxdigitj0j1jnlabsldexpldivlocaleconvlocaltimelocaltime_rloglog10longjmpmallocmblenmbrlenmbrtowcmbsinitmbsrtowcsmbstowcsmbtowcmemchrmemcmpmemcpymemmovememsetmktimemodfnextafternextafterlnexttowardnexttowardlnl_langinfoperrorpowprintfputcputcharputenvputsputwcputwcharqsortquantexpd32quantexpd64quantexpd128quantized32quantized64quantized128samequantumd32raiserandrand_rreallocregcompregerrorregexecregfreeremoverenamerewindscanfsetbufsetjmpsetlocalesetvbufsignalsinsinhsnprintfsprintfsqrtsrandsscanfstrcasecmpstrcatstrchrstrcmpstrcollstrcpystrcspnstrerrorstrfmonstrftimestrlenstrncasecmpstrncatstrncmpstrncpystrpbrkstrptimestrrchrstrspnstrstrstrtodstrtod32strtod64strtod128strtofstrtokstrtok_rstrtolstrtoldstrtoulstrxfrmswprintfswscanfsystemtantanhtimetime64tmpfiletmpnamtoasciitolowertouppertowctranstowlowertowupperungetcva_argva_copyva_endva_startvfprintfvfscanfvfwprintfvfwscanfvprintfvscanfvsprintfvsnprintfvsscanfvswprintfvswscanfvwprintfvwscanfwcrtombwcscatwcschrwcscmpwcscollwcscpywcscpywcsftimewcslenwcsncatwcsncmpwcsncpywcspbrkwcsptimewcsrchrwcsrtombswcsspnwcsstrwcstodwcstod32wcstod64wcstod128wcstofwcstokwcstolwcstoldwcstombswcstoulwcsxfrmwctobwctombwctranswctypewcwidthwmemchrwmemcmpwmemcpywmemmovewmemsetwprintfwscanfy0y1yn



Function Details : ungetwc

wint_tungetwc(wint_t wc,FILE * stream) ;

Return Type : wint_t

An integer type capable of storing any wide character value or the special value WEOF, used in wide-character input/output functions.
Read about return values of ungetwc function .

1st Parameter Type : wint_t

An integer type capable of storing any wide character value or the special value WEOF, used in wide-character input/output functions.

1st Parameter

The wide character to be pushed back into the input stream. It must be a valid `wint_t` value or `WEOF`.

2nd Parameter Type : FILE *

Pointer to FILE structure for file operations

2nd Parameter

Pointer to the input stream where the character will be pushed back.

Read more about parameters of ungetwc in parameters section
The ungetwcfunction in C language Pushes a wide character back onto a stream, where it is available for subsequent read operations.
The ungetwc function pushes the wide character specified by wc back onto the input stream pointed to by stream. This wide character will be the next character read by fgetwc(), getwc(), or any other wide character input function on that stream. ungetwc() guarantees only one wide character of pushback.
The ungetwcfunction takes 2 parameters:
  • wint_t `wc`: The wide character to be pushed back into the input stream. It must be a valid `wint_t` value or `WEOF`.
  • FILE * `stream`: Pointer to the input stream where the character will be pushed back.
Pushes the wide character `wc` back onto the input stream `stream`, making it available to be read again. Only one character can be pushed back without reading, and it must be pushed back in reverse order if multiple characters are involved. Returns `wc` on success or `WEOF` if an error occurs.
The ungetwc function return value :
  • Returns the wide character pushed back, or WEOF if the operation fails

Output

This example reads a wide character from a file, pushes it back, and then reads it again.