小编use*_*035的帖子

获取错误:ISO C++禁止声明无类型

我收到以下错误:

ISO C++禁止声明ttTreeInsert没有类型

ISO C++禁止在没有类型的情况下声明ttTreeDelete

ISO C++禁止在没有类型的情况下声明ttTreePrint

int ttTree的原型:: ttTreePrint()与类ttTree中的任何一个都不匹配

候选人是:void ttTree :: ttTreePrint()

这是我的头文件:

#ifndef ttTree_h
#define ttTree_h

class ttTree 
{
public:
  ttTree(void);
  int ttTreeInsert(int value);
  int ttTreeDelete(int value);
  void ttTreePrint(void);

};

#endif
Run Code Online (Sandbox Code Playgroud)

这是我的.cpp文件:

#include "ttTree.h"

ttTree::ttTree(void)
{

}

ttTree::ttTreeInsert(int value)
{
}

ttTree::ttTreeDelete(int value)
{
}

ttTree::ttTreePrint(void)
{
}
Run Code Online (Sandbox Code Playgroud)

任何人都可以指出导致这些错误的原因吗?谢谢!

c++ constructor class declaration function

32
推荐指数
2
解决办法
10万
查看次数

标签 统计

c++ ×1

class ×1

constructor ×1

declaration ×1

function ×1