#include "stdafx.h"
#include "iostream"
#include "windows.h"
#include "string"
#include "cstring"
using namespace std;
struct ch
{
char name[21];
int num;
string party;
};
int main(int argc, char* argv[])
{
ch ch1=
{
"wang",
18,
"zhan"
};
ch ch2;
ch2=ch1;
cout<<ch1.name<<ch1.num<<ch1.party<<endl;
cout<<ch2.name<<ch2.num<<ch2.party<<endl;
system("pause");
return 0;
}
简单的结构体成员赋值
最新推荐文章于 2024-02-15 08:42:17 发布