⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 student.h

📁 VC++技术内幕(第四版)的实例
💻 H
字号:
// student.h
class CStudent : public CObject
{
    DECLARE_DYNAMIC(CStudent)
public:
    CString m_name;
    LONG    m_lGrade;

    CStudent() {
        m_lGrade = 0L;
    }

    CStudent(const char* szName, long lGrade) : m_name(szName) {
        m_lGrade = lGrade;
    }

    CStudent(const CStudent& s) : m_name(s.m_name) { // copy constructor
        m_lGrade = s.m_lGrade;
    }

    const CStudent& operator =(const CStudent& s) {
        m_name   = s.m_name;
        m_lGrade = s.m_lGrade;
        return *this;
    }

    BOOL operator ==(const CStudent& s) const
    {
        if ((m_name == s.m_name) && (m_lGrade == s.m_lGrade)) {
          return TRUE;
        }
        else {
          return FALSE;
        }
    }

    BOOL operator !=(const CStudent& s) const
    {
        // Let's make use of the operator we just defined!
        return !(*this == s);
    }

#ifdef _DEBUG
    void Dump(CDumpContext& dc) const;
#endif
};

⌨️ 快捷键说明

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