English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
C Standard Library - <string.h>
C Library Function char *strcat(char *dest, const char *src) Appending src The string pointed to is appended to dest The end of the string pointed to.
Below is the declaration of the strcat() function.
char *strcat(char *dest, const char *src)
The function returns a pointer to the final destination string dest.
The following example demonstrates the usage of the strcat() function.
#include <stdio.h> #include <string.h> int main () { char src[50], dest[50]; strcpy(src, "This is source"); strcpy(dest, "This is destination"); strcat(dest, src); printf("The ultimate destination string: |%s|", dest); return(0); }
Let's compile and run the above program, which will produce the following result:
The ultimate destination string: |This is destinationThis is source|