INtime SDK Help
strcat, strcat_s, wcscat, wcscat_s

Appends a null-terminated string2 to string1.

#include <string.h>

char *strcat (char *string1, const char *string2);
errno_t strcat_s(char *string1, rsize_t s1max, const char *string2);

#include <wchar.h>

wchar_t *wcscat(wchar_t *string1, const wchar_t *string2);
errno_t wcscat_s(wchar_t *string1, size_t s1max, const wchar_t *string2);

Parameters

string1
Destination string; must contain a null character marking the end of the string.
s1max
The maximum size of the string1 buffer.
string2
Source string appended to string1; must contain a null character marking the end of the string.

Remarks

strcat terminates the resulting string with a null character \0. strcat performs no overflow checking when strings are appended.

The strcat_s function appends a copy of the string pointed to by string2 (including the terminating null character) to the end of the string pointed to by string1. The initial character from string2 overwrites the null character at the end of string1. All elements following the terminating null character (if any) written by strcat_s in the array of s1max characters pointed to by string1 take unspecified values when strcat_s returns.

The strcat_s function is subject to runtime contraints:

If there is a runtime-constraint violation, then if string1 is not a null pointer and s1max is greater than zero and not greater than RSIZE_MAX, then strcat_s sets string1[0] to the null character.

wcscat and wcscat_s are the wide-character versions of strcat and strcat_s.

Return Values

strcat returns a pointer to the concatenated string.

strcat_s returns zero on successful completion, or else a non-zero value.

Generic Text Routines

tchar.h routine _UNICODE not defined _UNICODE defined
_tcscat strcat _wcscat
_tcscat_s strcat_s _wcscat_s

Requirements

Versions Defined in Include Link to
INtime 3.0
INtime 4.2 (strcat_s)
INtime 6.0 (wide-character and generic text versions)
intime/rt/include/string.h
intime/rt/include/wchar.h
intime/rt/include/tchar.h
string.h
wchar.h
tchar.h
clib.lib
See Also