1
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
char *a = "Hello ";
const char *b = "World";
printf("%s", strcat(a, b));
system("PAUSE");
return EXIT_SUCCESS;
}
字符串文字不可修改。 http://stackoverflow.com/questions/1614723/why-is-this-c-code-causing-a-segmentation-fault/1614739#1614739 – AnT 2010-01-14 08:19:22