新手请教,怎么在头文件中引用外部类
student.h如下:
#include <stdio.h>
class student{
private:
char* name;
int age;
public:
void setAge(int age);
int getAger();
};
=================================
room.h如下:
#include <stdio.h>
#include "student.h"
class room{
private:
student* name=new student[10];
};
编译room.h时报错,提示 Type 'student‘ could not be resolved
如果把两个h文件合并为1个则不会报错,请问下room.h怎么引用student.h定义的类呢