char * strncat ( char * destination, const char * source, size_t num );
Append characters from string
Appends the first num characters of source to destination, plus a terminating null-character.
If the length of the C string in source is less than num, only the content up to the terminating null-character is copied.
- Pointer to the destination array, which should contain a C string, and be large enough to contain the concatenated resulting string, including the additional null-character.
- C string to be appended.
- Maximum number of characters to be appended.
size_t is an unsigned integral type.
destination is returned.
/* strncat example */
int main ()
strcpy (str1,"To be ");
strcpy (str2,"or not to be");
strncat (str1, str2, 6);
- Concatenate strings (function)
- Copy characters from string (function)
- Copy block of memory (function)