Scroll Down to See All▾
abortabsacosasctimeasctime_rasinassertatanatan2atexitatofatoiatolbsearchbtowccalloccatclosecatgetscatopenceilclearerrclockcoscoshctimectime_rdifftimediverferfcexitexpfabsfclosefdopenfeofferrorfflushfgetcfgetposfgetsfgetwcfgetwsfopenfprintffputcfputwsfreadfreefreopenfrexpfscanffseekfsetposftellfwidefwprintffwritefwscanfgetcgetchargetenvgetwcgetwchargmtimegmtime_rhypotisalnumisalphaisasciiisblankiscntrlisdigitisgraphislowerisprintispunctisspaceisupperiswalnumiswalphaiswblankiswcntrliswctypeiswdigitiswgraphiswloweriswprintiswpunctiswspaceiswupperiswxdigitisxdigitj0j1jnlabsldexpldivlocaleconvlocaltimelocaltime_rloglog10longjmpmallocmblenmbrlenmbrtowcmbsinitmbsrtowcsmbstowcsmbtowcmemchrmemcmpmemcpymemmovememsetmktimemodfnextafternextafterlnexttowardnexttowardlnl_langinfoperrorpowprintfputcputcharputenvputsputwcputwcharqsortquantexpd32quantexpd64quantexpd128quantized32quantized64quantized128samequantumd32raiserandrand_rreallocregcompregerrorregexecregfreeremoverenamerewindscanfsetbufsetjmpsetlocalesetvbufsignalsinsinhsnprintfsprintfsqrtsrandsscanfstrcasecmpstrcatstrchrstrcmpstrcollstrcpystrcspnstrerrorstrfmonstrftimestrlenstrncasecmpstrncatstrncmpstrncpystrpbrkstrptimestrrchrstrspnstrstrstrtodstrtod32strtod64strtod128strtofstrtokstrtok_rstrtolstrtoldstrtoulstrxfrmswprintfswscanfsystemtantanhtimetime64tmpfiletoasciitolowertouppertowctranstowlowertowupperungetcungetwcva_argva_copyva_endva_startvfprintfvfscanfvfwprintfvfwscanfvprintfvscanfvsprintfvsnprintfvsscanfvswprintfvswscanfvwprintfvwscanfwcrtombwcscatwcschrwcscmpwcscollwcscpywcscpywcsftimewcslenwcsncatwcsncmpwcsncpywcspbrkwcsptimewcsrchrwcsrtombswcsspnwcsstrwcstodwcstod32wcstod64wcstod128wcstofwcstokwcstolwcstoldwcstombswcstoulwcsxfrmwctobwctombwctranswctypewcwidthwmemchrwmemcmpwmemcpywmemmovewmemsetwprintfwscanfy0y1ynFunction Details : tmpnam
char *tmpnam(char * str) ;
Return Type : char *
String pointer (array of characters)
Read about return values of tmpnam function .
1st Parameter Type : char *
String pointer (array of characters)
1st Parameter
Pointer to a user-provided array of at least `L_tmpnam` characters where the function can store the generated file name. If `str` is `NULL`, the function uses an internal static buffer.
Read more about parameters of tmpnam in parameters section
The tmpnamfunction in C language Generates a unique temporary filename.
The tmpnam function generates a string that is a valid filename and that is not the same as the name of an existing file. This function is potentially dangerous because it creates a window of opportunity between the generation of the name and the creation of the file. For a safer alternative, consider using tmpfile().
The tmpnamfunction takes 1
parameter:Generates a unique temporary file name. If `str` is not `NULL`, the file name is stored in the provided buffer. If `str` is `NULL`, the function uses and returns a pointer to an internal static buffer. Returns a pointer to the generated file name or `NULL` if an error occurs. The generated name is not guaranteed to correspond to an existing file, and it is the user's responsibility to create the file if needed.
- •char * `str`: Pointer to a user-provided array of at least `L_tmpnam` characters where the function can store the generated file name. If `str` is `NULL`, the function uses an internal static buffer.
The tmpnam function return value :
- If the argument is NULL, returns a pointer to an internal static array
- If the argument is not NULL, returns the argument
Output
This example generates a temporary filename and stores it in a buffer.