Here is a quote from the strcat() manual : "The strcat() function appends the src string to the dest string, overwriting the null byte ('\0') at the end of dest, and then adds a terminating null byte. The strings may not overlap, and the dest string must have enough space for the result."
The problem here is that s1 and s2 point to static strings which are "read only", so if you try to do a strcat operation, with such a string in the dest parameters, you will get an error.
The best way to create your hello world string here is to malloc it so it will be able to contain both s1 and s2. Also, don't forget to add a '\n' at the end of your printf format string otherwise you might be surprised.
Here is the code I would write if I were you :
int main()
{
char* s1 = "Hello ";
char* s2 = "World !";
char *s3 = malloc((strlen(s1) + strlen(s2) + 1) * sizeof(char));
/* +1 is for the null terminating character
and sizeof(*s3) is the actual size of a char. */
if (s3)
{
strcat(s3, s1);
strcat(s3, s2);
printf("%s\n", s3);
free(s3); // always free what you alloc when you don't need it anymore.
}
return 0;
}