strcat, _mbscat, wcscat

De RAD Studio
Aller à : navigation, rechercher

Remonter à 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++", *Embarcadero = "Embarcadero";
    strcpy(destination, Embarcadero);
    strcat(destination, blank);
    strcat(destination, c);
    printf("%s\n", destination);
    return 0;
 }



Portability



POSIX Win32 ANSI C ANSI C++

strcat

+

+

+

+

_mbscat

+

wcscat

+

+

+