student.~c

来自「一次作业练习」· ~C 代码 · 共 35 行

~C
35
字号
#ifndef STUDENT_H
#define STUDENT_H

#include <fstream>
#include <string>

class Student{
      public:
             Student();//post: has constructed an empty Student-object
             Student(string n, int id);//post: has constructed an student-object with name = n, student_id = id
             string get_name();
             int get_id();
             void set_name(string n);
             void set_id(int id);
             void read(istream& fin);//pre: fin contains at least one line with a name and a student-id
                                    //post: has read and stored the name and student-id
             void write(ostream& fout);//post: has written a line containing the name and the student_id


      private:
              string name;
              int student_id;






};



#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?