C strcat() function with example

The strcat() library function in C Language concatenates two strings. This function appends string to the original destination string and returns the pointer to the destination string.

Basic Syntax

char* strcat(char* dest, const char* src);

And the parameters are:

ParameterDescription
destThis parameter specifies the pointer to destination array to which string to be appended. It should have enough space to contain the resulting string.
srcThis specifies the string to be appended

Return Value

This function returns the pointer to the destination string dest.

Example

1. Following is the example for strcat() function in C.

The output should be:

Final destination string: Welcome to CrazyGeeks.ORG

2. Following is the example for strcat() function in C.

The output should be:

Final destination string: Java Programming

LEAVE A REPLY

Please enter your comment!
Please enter your name here