ch10_2.cpp
资源名称:c.rar [点击查看]
上传用户:puke2000
上传日期:2022-07-25
资源大小:912k
文件大小:0k
源码类别:
C#编程
开发平台:
Visual C++
- //**********************
- //** ch10_2.cpp **
- //**********************
- #include <iostream.h>
- struct Person
- {
- char name[20];
- unsigned long id;
- float salary;
- };
- Person pr1={"Frank Voltaire",12345678,3.35};
- void main()
- {
- Person pr2;
- pr2=pr1; //结构变量的赋值
- cout <<pr2.name <<" "
- <<pr2.id <<" "
- <<pr2.salary <<endl;
- }