Scroll Down to See All
abortabsacosasctimeasctime_rasinassertatanatan2atexitatofatoiatolbsearchbtowccalloccatclosecatgetscatopenceilclearerrclockcoscoshctimectime_rdifftimediverferfcexitexpfabsfclosefdopenfeofferrorfflushfgetcfgetposfgetsfgetwcfgetwsfopenfprintffputcfputwsfreadfreefreopenfrexpfscanffseekfsetposftellfwidefwprintffwritefwscanfgetcgetchargetenvgetwcgetwchargmtimegmtime_rhypotisalnumisalphaisasciiisblankiscntrlisdigitisgraphislowerisprintispunctisspaceisupperiswalnumiswalphaiswblankiswcntrliswctypeiswdigitiswgraphiswloweriswprintiswpunctiswspaceiswupperiswxdigitisxdigitj0j1jnlabsldexpldivlocaleconvlocaltimelocaltime_rloglog10longjmpmallocmblenmbrlenmbrtowcmbsinitmbsrtowcsmbstowcsmbtowcmemchrmemcmpmemcpymemmovememsetmktimemodfnextafternextafterlnexttowardnexttowardlnl_langinfoperrorpowprintfputcputcharputenvputsputwcputwcharqsortquantexpd32quantexpd64quantexpd128quantized32quantized64quantized128samequantumd32raiserandrand_rreallocregcompregerrorregexecregfreeremoverenamerewindscanfsetbufsetjmpsetlocalesetvbufsignalsinsinhsnprintfsprintfsqrtsrandsscanfstrcasecmpstrcatstrchrstrcmpstrcollstrcpystrcspnstrerrorstrfmonstrftimestrlenstrncasecmpstrncmpstrncpystrpbrkstrptimestrrchrstrspnstrstrstrtodstrtod32strtod64strtod128strtofstrtokstrtok_rstrtolstrtoldstrtoulstrxfrmswprintfswscanfsystemtantanhtimetime64tmpfiletmpnamtoasciitolowertouppertowctranstowlowertowupperungetcungetwcva_argva_copyva_endva_startvfprintfvfscanfvfwprintfvfwscanfvprintfvscanfvsprintfvsnprintfvsscanfvswprintfvswscanfvwprintfvwscanfwcrtombwcscatwcschrwcscmpwcscollwcscpywcscpywcsftimewcslenwcsncatwcsncmpwcsncpywcspbrkwcsptimewcsrchrwcsrtombswcsspnwcsstrwcstodwcstod32wcstod64wcstod128wcstofwcstokwcstolwcstoldwcstombswcstoulwcsxfrmwctobwctombwctranswctypewcwidthwmemchrwmemcmpwmemcpywmemmovewmemsetwprintfwscanfy0y1yn



Function Details : strncat

char *strncat(char * dest,const char * src,size_t n) ;

Return Type : char *

String pointer (array of characters)
Read about return values of strncat function .

1st Parameter Type : char *

String pointer (array of characters)

1st Parameter

Pointer to the destination null-terminated string where the source string will be appended.

2nd Parameter Type : const char *

Pointer to read-only string

2nd Parameter

Pointer to the null-terminated source string to append to `dest`.

3rd Parameter Type : size_t

Platform-specific unsigned type for array indices and memory sizes.

3rd Parameter

The maximum number of characters to append from `src`, excluding the null terminator.

Read more about parameters of strncat in parameters section
The strncatfunction in C language Appends a specified number of characters from the source string to the destination string.
The strncat function appends not more than n characters from the string pointed to by src to the end of the string pointed to by dest. The first character of src overwrites the null character at the end of dest. A terminating null character is always appended to the result.
The strncatfunction takes 3 parameters:
  • char * `dest`: Pointer to the destination null-terminated string where the source string will be appended.
  • const char * `src`: Pointer to the null-terminated source string to append to `dest`.
  • size_t `n`: The maximum number of characters to append from `src`, excluding the null terminator.
Appends up to `n` characters from the source string `src` to the destination string `dest`. A null terminator is added to the resulting string. The destination string must have enough space to hold the result. Returns a pointer to the destination string `dest`.
The strncat function return value :
  • Returns a pointer to the resulting string dest

Output

This example demonstrates basic usage of strncat to append the first 5 characters of 'World!' to 'Hello, '.