#include<iostream>
#include<string.h>
using namespace std;
int main()
{
struct student
{
char name[20];
int num;
float score;
}stu;
student *p;
p=&stu;
strcpy(stu.name,"ZHOU ZHIXIANG");
(*p).num=123456;
p->score=81.9;
cout<<stu.name<<" 同学的学号是: "<<stu.num<<" 成绩是:"<<stu.score<<endl;
cout<<(*p).name<<" 同学的学号是: "<<(*p).num<<" 成绩是 "<<(*p).score<<endl;
cout<<p->name<<" 同学的学号是: "<<p->num<<" 成绩是 "<<p->score<<endl;
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: