ch10_4.cpp
资源名称:c.rar [点击查看]
上传用户:puke2000
上传日期:2022-07-25
资源大小:912k
文件大小:0k
源码类别:
C#编程
开发平台:
Visual C++
- //**********************
- //** ch10_4.cpp **
- //**********************
- #include <iostream.h>
- #include <string.h>
- struct Person
- {
- char name[20];
- unsigned long id;
- float salary;
- };
- void main()
- {
- Person pr1;
- Person* prPtr;
- prPtr=&pr1;
- strcpy((*prPtr).name,"David Marat");
- (*prPtr).id=987654321;
- (*prPtr).salary=335.0;
- cout <<(*prPtr).name <<" "
- <<(*prPtr).id <<" "
- <<(*prPtr).salary <<endl;
- }