c语言error C2228: left of '.tag' must have class/struct/union type0
#include #include #include #define n 4 #define m 3 #define w 2 struct achievement {int schoolnumber; char name[20]; int mark; int result;}; struct pro {int tag; struct achievement ach[5]... #include
#include
#include
#define n 4
#define m 3
#define w 2
struct achievement
{int schoolnumber;
char name[20];
int mark;
int result;};
struct pro
{int tag;
struct achievement ach[5];
int number;};
{struct pro date;
struct node *next;};
void listinitiate(struct node * * head)
{if(( * head=(struct node * )malloc(sizeof(struct node)))==NULL) exit(1);
( * head)->next=NULL;}
void main()
{int i,j,t;
int x[n]={0};int y[n]={0};
struct node * head;
struct node * p;
struct node * q;
listinitiate(&head);
p=head;
for(i=0;i
{j=i+1;
printf("请输入第%d个项目的信息\n",j);
p->date,number=j;
printf("所取得名次数为:");
scanf("%d",&p->date.tag);
while(p->date.tag!=3&&p->date.tag!=5)
{printf("输入有误请从新输入!");
printf("所取得名次数为:");
scanf("%d",&p->date.tag);}
t=1;
while(t<=p->date.tage)
{
printf("第%名的名字:",t);
scanf("%s",&p->date.ach[t-1].name);
printf("第%名的学校:",t);
scanf("%s",&p->date.ach[t-1].schoolnumber);
printf("第%名的分数为:",t);
scanf("%s",&p->date.ach[t-1].mark);
p->date.ach[t-1].result=t;
t++;
}
E:\1.cpp(35) : error C2227: left of '->date' must point to class/struct/union
E:\1.cpp(35) : error C2228: left of '.tag' must have class/struct/union type
这是怎么回事? 展开