strcat, _mbscat, wcscat
Go Up to string.h Index
Header File
string.h, mbstring.h
Category
Memory and String Manipulation Routines, Inline Routines
Prototype
char *strcat(char *dest, const char *src);
wchar_t *wcscat(wchar_t *dest, const wchar_t *src);
unsigned char *_mbscat(unsigned char *dest, const unsigned char *src);
Description
Appends one string to another.
strcat appends a copy of src to the end of dest. The length of the resulting string is strlen(dest) + strlen(src).
Return Value
strcat returns a pointer to the concatenated strings.
Example
#include <string.h> #include <stdio.h> int main(void) { char destination[25]; char *blank = " ", *c = "C++", *CBuilder = "CBuilder"; strcpy(destination, CBuilder); strcat(destination, blank); strcat(destination, c); printf("%s\n", destination); return 0; }
Portability
POSIX | Win32 | ANSI C | ANSI C++ | |
---|---|---|---|---|
strcat |
+ |
+ |
+ |
+ |
_mbscat |
+ |
|||
wcscat |
+ |
+ |
+ |