注册 登录
编程论坛 C++教室

有关ios::base.h

九天冥盟 发布于 2016-06-10 15:36, 5077 次点击
student-main.cpp:

#include "class-student.h"
class student_io
{
    public:
       inline bool f_input(student &t,fstream File);
       bool f_output(fstream File);
        //这两个function,就是一个平台,将student类中的被保护成员和写入数据可以共存
       student *b;          //数据的储存地
       void display();
       student_io( int n=1)
       {
           b=new student[n];
       }
       ~student_io()
       {
           delete []b;
       }
};
int main()
{
 ..........;
}
class-student.h:

class student_io;
class  student
{
    public:
       bool input(long temp);
        float average();
        long sum();
        void display();
        friend student_io;
    protected:
        long number;          //学生信息
        char *name;
        struct subject
        {
            float math;
            float english;
            float computer;
        }data;
};

error:'std::ios_base::io_base(const std::ios_base &)' is private
error:initializing argument 2 of 'bool student_io::f_input(student& std::fstream)';

我怎么也编译不通过,总是跳出一个文件iOS::base.h,而且还弹出许多error;
请大家看看
2 回复
#2
九天冥盟2016-06-26 00:30
555555
#3
rjsp2016-06-26 01:29
传引用

其它就不评价了
1