1 #include <iostream>
 2 #include <string.h>
 3 /* run this program using the console pauser or add your own getch, system("pause") or input loop */
 4 using namespace std;
 5 struct Student
 6 {
 7     int num;
 8     string name;
 9     float score[3];
10 }
11 stu={12345,"Li Fung",99,87,78};
12 
13 int main(int argc, char** argv) {
14     void print(Student *);
15     Student *pt=&stu;
16     print(pt);
17     return 0;
18 }
19 
20 void print(Student *p)
21 {
22     cout <<p->name<<" "<<p->num<<" "<<p->score[0]<<" "
23     <<p->score[1]<<" "<<p->score[2]<<endl;
24 }

 

相关文章:

  • 2022-12-23
  • 2021-11-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-02
  • 2021-10-12
  • 2022-01-21
猜你喜欢
  • 2021-10-26
  • 2022-12-23
  • 2021-12-25
  • 2021-08-16
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案