strcat, wcscat, _mbscat
Aggiungere una stringa.Più versioni sicure di queste funzioni sono disponibili, vedere strcat_s, wcscat_s, _mbscat_s.
![]() |
---|
_mbscat_s non può essere utilizzato nelle applicazioni eseguite nelle finestre runtime.Per ulteriori informazioni, vedere Funzioni CRT non supportate con /ZW. |
char *strcat(
char *strDestination,
const char *strSource
);
wchar_t *wcscat(
wchar_t *strDestination,
const wchar_t *strSource
);
unsigned char *_mbscat(
unsigned char *strDestination,
const unsigned char *strSource
);
template <size_t size>
char *strcat(
char (&strDestination)[size],
const char *strSource
); // C++ only
template <size_t size>
wchar_t *wcscat(
wchar_t (&strDestination)[size],
const wchar_t *strSource
); // C++ only
template <size_t size>
unsigned char *_mbscat(
unsigned char (&strDestination)[size],
const unsigned char *strSource
); // C++ only
Parametri
strDestination
Stringa di destinazione con terminazione null.strSource
Stringa di origine con terminazione null.
Valore restituito
Ognuna di queste funzioni restituisce la stringa di destinazione (strDestination).Nessun valore restituito è riservato per indicare un errore.
Note
La funzione strcat aggiunge strSource a strDestination e termina la stringa risultato con un carattere null.Il carattere iniziale di strSource sovrascrive il carattere di terminazione null di strDestination.Il comportamento di strcat non è definito se le stringhe di origine e di destinazione si sovrappongono.
![]() |
---|
Poiché strcat non controlla se uno spazio sufficiente in strDestination prima di aggiungere strSource, è una causa potenziale dei sovraccarichi del buffer.Considerare l'utilizzo di strncat anziché. |
wcscat e _mbscat sono versioni a caratteri di tipo "wide" e di caratteri multibyte di strcat.Gli argomenti e il valore restituito di wcscat sono stringhe di caratteri di tipo "wide", quelli di _mbscat sono stringhe di caratteri multibyte.Altrimenti queste tre funzioni si comportano in modo identico.
In C++, queste funzioni hanno modelli di overload che invocano le più recenti, controparti sicure di queste.Per ulteriori informazioni, vedere Assicurarsi che gli overload del modello.
Mapping di routine a Testo generico
TCHAR.H routine |
_UNICODE & _MBCS non definiti |
_MBCS definito |
_UNICODE definito |
---|---|---|---|
_tcscat |
strcat |
_mbscat |
wcscat |
Requisiti
Routine |
Intestazione obbligatoria |
---|---|
strcat |
<string.h> |
wcscat |
<string.h> o <wchar.h> |
_mbscat |
<mbstring.h> |
Per ulteriori informazioni sulla compatibilità, vedere Compatibilità nell'introduzione.
Esempio
Vedere l'esempio relativo strcpy.
Equivalente .NET Framework
Vedere anche
Riferimenti
strncat, _strncat_l, wcsncat, wcsncat_l, _mbsncat _mbsncat_l
strncmp, wcsncmp, _mbsncmp, _mbsncmp_l
strncpy, _strncpy_l, wcsncpy, _wcsncpy_l, _mbsncpy, _mbsncpy_l
_strnicmp, _wcsnicmp, _mbsnicmp, _strnicmp_l, _wcsnicmp_l, _mbsnicmp_l