strcat String function in C programming language
- Home
- function in C
- strcat String function in C programming language
- On
- By
- 0 Comment
- Categories: function in C, Pre-define String function in C
strcat String function in C programming language
strcat String function in C programming language
In this tutorial we will discuss about strcat String function in C programming language
Description
In C programming language strcat() String function is used to concatenate two string
strcat()–
The strcat() function appends a copy of the string targeted to by str2 to the end of the string targeted to by str1 .
Hence, Concatenates two string, Str2 can be concatenated at the end of the str1
Declaration
Syntex of strcat() string function in C Language
char *strcat(char *str1, const char *str2);
or
strncat(Destination String, Source String);
argument or parameter
str1 – Destination
str2 – source to be copied()
Returns
The strcat() function returns a pointer to s1(creating Concatenated string )
Required Header
the required header for strcat() String function in C Programming language
#include<string.h>
Example one – for strcat() function
#include <stdio.h> #include <string.h> int main() { char myname[100]="Subramaniam"; strcat(myname," Suganthan"); printf("%s\n",myname); getch(); return 0; }
When above program me is compiled it will produce the following result
Subramaniam Suganthan
There are other C programming language functions that are similar to the this function
Suggested for you
String function in C Language
Arithmetic function in C language