home *** CD-ROM | disk | FTP | other *** search
/ PC User 2001 August / APC_Aug2001_CD1.iso / workshop / c / files / student.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-06-03  |  1.0 KB  |  47 lines

  1. #if !defined( STUDENT_INCLUDED )
  2. #define STUDENT_INCLUDED
  3.  
  4. #include <string>
  5. #include <iostream>
  6. #include <fstream>
  7.  
  8.  
  9. const int LENSTR=128;
  10. const int LENDOB=12;
  11.  
  12. struct SStudent {
  13.     unsigned 
  14.     unsigned    m_studNo;
  15.     char        m_familyName[LENSTR];
  16.     char        m_otherNames[LENSTR];
  17.     char        m_address[LENSTR];
  18.     char        m_DOB[LENDOB];
  19. };
  20.  
  21. class CStudent {
  22. public:
  23.     CStudent();
  24.     CStudent(unsigned          sNo,
  25.              const std::string &fNam,
  26.              const std::string &oNam,
  27.              const std::string &addr,
  28.              const std::string &DOB);
  29.    unsigned          StudentNo() const;
  30.    const std::string &FamilyName() const;
  31.    const std::string &OtherName() const;
  32.    const std::string &Address() const;
  33.    const std::string &DOB() const;
  34.    bool  Read(std::ifstream &is);
  35.    bool  Write(std::ofstream &os);
  36.    bool  Print(std::ostream &os);
  37. private:
  38.     unsigned    m_studNo;
  39.     std::string m_familyName;
  40.     std::string m_otherNames;
  41.     std::string m_address;
  42.     std::string m_DOB;
  43. };    
  44.  
  45.  
  46.  
  47. #endif