在类的外面进行函数定义。
如:class Student{public : void display( ); //公用成员函数原型声明private : int num; string name; char sex; //以上3行是私有数据成员};void Student::display( )//在类外定义display类函数{ cout<<"num:"<
typedef struct numNode {
int code[3][3];
struct numNode * parent;
struct numNode * next;
struct numNode * next1;
}numNode;
把这一段放在类定义的外面,否则,类外定义的函数找不到nodeNum类型的定义,即改为如下:
typedef struct numNode {
int code[3][3];
struct numNode * parent;
struct numNode * next;
struct numNode * next1;
}numNode;
class eightNum
{
public:
numNode *getfirst(numNode * open);
} ;
numNode *eightNum::getfirst(numNode * open)
{
return open->next;
}