我有以下代码的错误:
int main(){
point *points = malloc(sizeof(point));
if (points == NULL){
printf("Memory allocation failed.\n");
return 1;
}
other_stuff(points);
free(points);
return 0;
}
void other_stuff(point points[]){
//stuff
realloc(points, number*sizeof(point))
}
Run Code Online (Sandbox Code Playgroud)
我搜索过,但只找到了很明显没有分配的例子.
在这里,我曾经malloc初始化points,后来改变了它的大小realloc; 那么当我来到free它时,指针"未分配"怎么样?