The strcat(first_string, second_string) function concatenates two strings and result is returned to first_string.
Syntax :
strcat(first_string, second_string)
Example :
#include <stdio.h>
int main(void)
{
char firststring[10]={'h','e','l','l','o',' ','\0'};
char secondstring[10]={'w','o','r','l','d','\0'};
strcat(firststring,secondstring);
printf("Value of first string is : %s",firststring);
}
Output :
Value of first string is : hello world
No comments:
Post a Comment