在功能调用中免费结构太多参数
free struct too many arguments in function call
我有一个列表结构:
typedef struct FaceNode{
FaceNode *next;
Face *aFace;
FaceNode *prev;
} FaceNode;
我将此结构用作成员:
FaceNode *myFaces;
并这样初始化(在构造函数中)
this->myFaces = (FaceNode*)malloc(sizeof(FaceNode)*1);
稍后我想如下释放它:
FaceNode *theCurrentFaceNode;
Face* theCurrentFace;
while(this->myFaces->next){
theCurrentFaceNode = this->myFaces;
theCurrentFace = theCurrentFaceNode->aFace;
this->myFaces = this->myFaces->next;
free(theCurrentFace);
free(theCurrentFaceNode);
}
现在我的IDE告诉我:"错误,函数呼叫中的争论太多"。
这是怎么回事?
欢呼
您显然已经声明了自己的名为 free
的函数,并且编译器发现,而不是您认为正在调用的函数。使用示波器分辨率操作员调用全局函数:
::free(theCurrentFace);
或找到其他free
功能,并给它一个不同的名称。它可能是您要实施的班级的成员;也看班级的祖先课程。
相关文章:
- 在没有太多条件句的情况下,我如何避免被零除
- 访问存储在向量C++中的结构的多态成员
- 错误:字符数组的初始值设定项太多
- 对象实例化调用构造函数的次数太多
- Levenshtein 两个文件的距离花费了太多时间
- 我有三个 getline,但是一旦编译,输入就太多了
- 将使用太多的纹理插值器 - 带旋转的着色器
- C/C++:socket() 创建在循环中失败,打开的文件太多
- 使用Visual Studio在虚幻引擎中创建一个新的类c ++给了我太多的错误
- C++:数组<>初始值设定项太多
- 从 cin 获取 c++ 中结构中多个枚举的输入
- GLib-ERROR:为GWakeup创建管道:打开的文件太多
- C++,从文件读取到结构,然后读取到向量(结构被推入向量太多次,而不仅仅是一次)
- 我会导致太多内存泄漏,以至于我的计算机无响应吗?
- cpp 初始值设定项太多 - 数组中的结构中的结构
- 错误:结构的初始值设定项太多
- 工会结构阵列的初始化太多
- 结构C++太多的初始值设定项
- 在功能调用中免费结构太多参数
- 结构和数组(“数组”的初始值设定项太多)C++