小编Ale*_*val的帖子

我如何释放()一个非堆对象?

#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int** intptrArray;
char word[50];
Run Code Online (Sandbox Code Playgroud)

在此之后的函数中使用 malloc 分配数组和单词后,我尝试在数组和单词上使用 free()。free(intptrArray) 似乎工作得很好,但是每次我尝试 free(word)、free(*word) 或 free(&word) 时,我都会遇到错误 - 最常见的是“尝试释放非堆对象”。

我该如何解决这个问题?蒂亚!

c string malloc free char

0
推荐指数
1
解决办法
1571
查看次数

标签 统计

c ×1

char ×1

free ×1

malloc ×1

string ×1