我怎样才能为 char** str 设置一个空值,因为我有“越界指针的取消引用:1 个字节(1 个元素)超过数组 im 使用 C 语言的结尾”的错误
while(part)
{
res = (char**)realloc(res, (i + 1) * sizeof(char*));
*(res + i) = mystrdup(part);
part = mystrdup(strtok(NULL, delim));
i++;
}
res = (char**)realloc(res, i * sizeof(char*));
*(res + i) = NULL; // This is where I Encounter the ERROR