Syntax of strcat() in C++

char *strcat(char *destination, const char *source);

strcat() Function in C++

The strcat() function in C++ is a predefined function in the <cstring> header file that is used to concatenate two strings, by appending a copy of the source string to the end of the destination string.

This function works by adding all the characters till the null character of the source string at the position where the null character is present in the destination string. Due to this, strcat() can only be used on null-terminated strings (Old C-Style Strings).

Similar Reads

Syntax of strcat() in C++

char *strcat(char *destination, const char *source);...

Parameters of strcat() in C++

destination: It is a pointer to the destination string. It should be large enough to store the concatenated string.source: It is a pointer to the source string which is appended to the destination string....

Return Value of strcat() in C++

The strcat() function returns a pointer to the destination string....

Example to Use strcat() in C++

Input: src = "GeeksforGeeks is an" dest = "Online Learning Platform" Output: GeeksforGeeks is an Online Learning Platform...

Contact Us