Achar**
总是让我感到困惑。以下代码生成分段错误。请解释...
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main()
{
char** nameList;
nameList = malloc(4*sizeof(char*));
nameList[0] = malloc(12); //not sure if needed but doesn't work either
nameList[0] = "Hello ";
printf("%s ",nameList[0]);// even this statement isn't executed
strcat(nameList[0], "World");
printf("%s ",nameList[0]);
return 0;
}