Loading...
Select Version
&pagelevel(4)&pagelevel
Definition | #include <string.h> char *strcat(char *s1, const char *s2);
The null byte (\0) at the end of string s1 is overwritten by the first character of string s2. |
Return val. | Pointer to the result string. |
Notes | Strings terminated with the null byte (\0) are expected as arguments.
The behavior is undefined if memory areas overlap. |
Example | #include <string.h> #include <stdio.h> int main(void) { char text1[BUFSIZ]; char text2[BUFSIZ]; printf("Example of strcat - please enter 2 text lines!\n"); if(scanf("%s %s", text1, text2) == 2) printf("%s\n", strcat(text1, text2)); return 0; } |
See also | strncat |