#include<stdio.h>
#include<conio.h>
#include<string.h>
int main()
{
struct student
{
char name[30];
int roll_no;
char add[40];
char subject[15];
}
struct student p;
printf("Enter the name of student:\t");
scanf("%s",p.name);
printf("Enter the roll no. of student:\t");
scanf("%d",&p.roll_no);
printf("Enter the address of student:\t");
scanf("%s",p.add);
printf("Enter student's subject:\t");
scanf("%s",p.subject);
printf("\nThus the name of student is:%s \nHis/her roll no is :%d \n He/she lives at:%s \t and his subject is:%s",p.name,p.roll_no,p.add,p.subject);
getch();
}
错误信息是---
13error: two or more data types in declaration of `p'
我正在使用代码块
答案 0 :(得分:9)
在结构定义之后加上;
...