定义一个学生类,成员包括学号,姓名,性别,班级,成绩。输入学生信息,使用构造函数初始化。输出学生信
展开全部
#define NAME_LEN 20
class CStudent
{
public:
CStudent()
{
memset(m_szName,'\0',NAME_LEN);
m_nGender = static_cast<int>(UNKNOW);
m_nClass = 0;
m_nGrade = 0;
}
CStudent(const char* pName,const int nGender,const int nClass,const int nGrade)
{
assert(pName);
memset(m_szName,'\0',NAME_LEN);
strcpy(m_szName,pName);
m_nGender = nGender;
m_nClass = nClass;
m_nGrade = nGrade;
}
void print_student()
{
//...
}
virtual ~CStudent()
{
}
private:
enum { UNKNOW = 0, MALE, FEMALE, };
char m_szName[NAME_LEN];
int m_nGender;
int m_nClass;
int m_nGrade;
};
int main(int argc,char* argv[])
{
//...
return 0;
}
class CStudent
{
public:
CStudent()
{
memset(m_szName,'\0',NAME_LEN);
m_nGender = static_cast<int>(UNKNOW);
m_nClass = 0;
m_nGrade = 0;
}
CStudent(const char* pName,const int nGender,const int nClass,const int nGrade)
{
assert(pName);
memset(m_szName,'\0',NAME_LEN);
strcpy(m_szName,pName);
m_nGender = nGender;
m_nClass = nClass;
m_nGrade = nGrade;
}
void print_student()
{
//...
}
virtual ~CStudent()
{
}
private:
enum { UNKNOW = 0, MALE, FEMALE, };
char m_szName[NAME_LEN];
int m_nGender;
int m_nClass;
int m_nGrade;
};
int main(int argc,char* argv[])
{
//...
return 0;
}
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
是数据库吧?你自己新建一个,里面就有那个功能的,
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
excel?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询