C++-struct类的新特性当class用

 #include <iostream>
#include <iomanip>
#include <string> using namespace std; struct Student
{
int num;
string name;
char sex;
int age;
Student(int newnum,string newname,char newsex,int newage):num(newnum),name(newname),sex(newsex),age(age)
{
cout<<"Num: "<<num<<endl;
cout<<"Name: "<<name<<endl;
cout<<"Sex: "<<sex<<endl;
cout<<"Age: "<<age<<endl;
}
}; int main()
{
Student stu(,"Lin Lin",'F',); return ;
}
上一篇:V4L2(二)虚拟摄像头驱动vivi深入分析【转】


下一篇:SQL Server数据库账号密码变更后导致vCenter Server无法访问数据库