Tuesday, 27 August 2013

How to concat two char* string in C program

How to concat two char* string in C program

I wrote the following C program:
int main(int argc, char** argv) {
char* str1;
char* str2;
str1 = "sssss";
str2 = "kkkk";
printf("%s",strcat(str1,str2));
return (EXIT_SUCCESS);
}
I want to concatenate the two strings but it doesn't work. Please help me,
thanks.

No comments:

Post a Comment