Can't pass filestream as function parameter?

后端 未结 2 1366
花落未央
花落未央 2021-01-22 09:42

Here is my code for an assignment I have. Whenever I try and compile I get an error for my read function due to something in \"ios_base.h\" I am not sure what to do and/or if my

2条回答
  •  再見小時候
    2021-01-22 10:46

    Stream objects are not copyable. Their copy constructor is deleted. They must be passed by reference, not by value:

    int read(ifstream &, Student s[]);
    
    void print(ofstream &fout, Student s[], int amount);
    

    etc...

提交回复
热议问题