why does this code crash?
- by ashish yadav
why does this code crash?
is using strcat illegal on character pointers?
#include <stdio.h>
#include <string.h>
int main()
{
char *s1 = "Hello, ";
char *s2 = "world!";
char *s3 = strcat(s1, s2);
printf("%s",s3);
return 0;
}
please give a proper way with referring to both array and pointers.