#include <iostream>
#include <string>
using namespace std;
int main( )
{
struct Student
{
int num;
string name;
char sex;
float score;
};
Student stu;
Student *p=&stu;
stu.num=10001;
stu.name="KYO";
stu.sex='F';
stu.score=89.5;
cout<<p -> num<<" "<<(*p).name<<" "<<(*p).sex<<" "<<(*p).score<<endl;
return 0;
}
追问![](https://video.ask-data.xyz/img.php?b=https://iknow-pic.cdn.bcebos.com/bba1cd11728b4710d967ab5dc7cec3fdfd0323d2?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_600%2Ch_800%2Climit_1%2Fquality%2Cq_85%2Fformat%2Cf_auto)
![](https://video.ask-data.xyz/img.php?b=https://iknow-pic.cdn.bcebos.com/203fb80e7bec54e72f1b4c8fbd389b504ec26aaf?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_600%2Ch_800%2Climit_1%2Fquality%2Cq_85%2Fformat%2Cf_auto)
不好意思 发错了
![](https://video.ask-data.xyz/img.php?b=https://iknow-pic.cdn.bcebos.com/1f178a82b9014a906aac172cad773912b21bee95?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_600%2Ch_800%2Climit_1%2Fquality%2Cq_85%2Fformat%2Cf_auto)
追答定义结构体struct student后面不能加分号 它不是一句完整的语句
追问对的 谢谢你
本回答被提问者和网友采纳