更新时间:2022-01-29 01:04:03
您 createArray
函数声明和一个错误的工具。你需要字符数组的指针,它的类型(的char **
),所以创建并返回这样一个数组:
Your createArray
functions is declared and implement with a mistake. You need an array of char pointers, which is of type (char **
), so create and return such an array:
char** createArray(int count) {
char** a;
a = malloc(sizeof(char*) * count);
if (a == 0) {
fprintf(stderr, "memory allocation failed\n");
exit(1);
}
return a;
}