小编gri*_*llo的帖子

错误:成员函数不能在其类之外声明。

我的 heap.h 文件包含:

bool insert(int key, double data);
Run Code Online (Sandbox Code Playgroud)

在我的 heapCPP.cpp 文件中,我有:

 bool heap::insert(int key, double data){
    bool returnTemp;
    node *temp = new node(key, data);

    returnTemp = insert(temp);
    delete temp;
    return returnTemp;
}
Run Code Online (Sandbox Code Playgroud)

但是,我收到一条错误消息,指出“成员函数“heap::insert”可能不会在其类之外重新声明。

c++

5
推荐指数
3
解决办法
2万
查看次数

标签 统计

c++ ×1