c语言求改错
题目
c语言求改错
#include
typedef struct Birthday
{
short year;
short month;
short day;
}Bir;
typedef struct Student
{
char name[10];
long ID;
Bir birthday;
float height;
float weight;
}STU;
STU MyClass[5];
void StudyStructMem()
{
printf("\tsize\tAddr0\tAddr1\tAddr2\tAddr3\tAddr4\tAddr5\n");
printf("Bithday:%d\t",sizeof(Bir));
printf("%x\t%x\t%x\t%x\n",&Bir,&Bir.year,&Bir.month,&Bir.day);
printf("Student:%d\t",sizeof(STU));
printf("%x\t%x\t%x\t%x\t%x\t%x\n",&STU,&STU.name,&STU.ID,&STU.Br,&STU.height,&STU.weight);
printf("MyClass:%d\t",sizeof(MyClass));
printf("%x\t%x\t%x\t%x\t%x\t%x\n",&MyClass,&MyClass[0],&MyClass[1],&MyClass[2],&MyClass[3],&MyClass[4]);
}
void main()
{
StudyStructMem();
}
C:\Users\IdeaPad\Desktop\Project8\eight1.c(27) :error C2275:'Bir' :illegal use of this type as an expression
C:\Users\IdeaPad\Desktop\Project8\eight1.c(9) :see declaration of 'Bir'
C:\Users\IdeaPad\Desktop\Project8\eight1.c(29) :error C2275:'STU' :illegal use of this type as an expression
C:\Users\IdeaPad\Desktop\Project8\eight1.c(18) :see declaration of 'STU'
答案
#include <stdio.h>typedef struct Birthday{ short year; short month; short day;}Bir;typedef struct Student{ char name[10]; ...
举一反三
已知函数f(x)=x,g(x)=alnx,a∈R.若曲线y=f(x)与曲线y=g(x)相交,且在交点处有相同的切线,求a的值和该切线方程.
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
最新试题
- an=2^n/(2^n+1),求证:a1*a2*a3*a4*a5*.*an>1/(2e)
- 五年级同学做操,每9人或每15人一队,都正好缺4人.已知五年级人数在160~190人之
- 夏天当我们从空调房里走出来时,眼睛会变得一片模糊,说明空气中含有什么?
- the onions are on the refrigerator(改为一般疑问句)
- 如何识别毛霉、根霉、曲霉、青霉?
- 一辆汽车从甲地到乙地,平均每小时行驶60千米,行了8/9小时,刚好行了全程的4/15.甲地到乙地有多少千米?
- 为什么水和其他物质不一样,在4摄氏度时密度最大?
- 函数f(x)=ax^2+b|x |+c(a≠0),其定义域R分成了四个单调区间,则实数a,b,c满足
- the best way to learn english is to use it里面2个to do
- my good friend
热门考点