你定义的m_nCode,m_sName,m_nAge,m_lScore 是CStudent的成员,
而你这句里pStudent = new CStudent(m_nCode,m_sName,m_nAge,m_lScore);
那些变经量不是成员当然就没有定义。要这么用
long code=1;
CString name="someone";
long age=20;
double score=99;
pStudent = new CStudent(code,name,age,score);这样以后,就有了这些变量:
pStudent->m_nCode,
pStudent->m_sName,
pStudent->m_nAge,
pStudent->m_lScore;