You are here : cpp0strncat

strncat() - 0

The C library function char *strncat(char *dest, const char *src, size_t n) appends the string pointed to by src to the end of the string pointed to by dest up to n characters long.


Syntax

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


Example

#include <stdio.h>
#include <string.h>

int main ()
{
   char src[50], dest[50];

   strcpy(src,  "This is source");
   strcpy(dest, "This is destination");

   strncat(dest, src, 15);

   printf("Final destination string : |%s|", dest);
   
   return(0);
}


Output / Return Value

Final destination string : |This is destinationThis is source|


Limitations


Alternatives / See Also


Reference