题目
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
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'
提问时间:2021-02-12
答案
#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的值和该切线方程.
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
最新试题
- 1an=2^n/(2^n+1),求证:a1*a2*a3*a4*a5*.*an>1/(2e)
- 2五年级同学做操,每9人或每15人一队,都正好缺4人.已知五年级人数在160~190人之
- 3夏天当我们从空调房里走出来时,眼睛会变得一片模糊,说明空气中含有什么?
- 4the onions are on the refrigerator(改为一般疑问句)
- 5如何识别毛霉、根霉、曲霉、青霉?
- 6一辆汽车从甲地到乙地,平均每小时行驶60千米,行了8/9小时,刚好行了全程的4/15.甲地到乙地有多少千米?
- 7为什么水和其他物质不一样,在4摄氏度时密度最大?
- 8函数f(x)=ax^2+b|x |+c(a≠0),其定义域R分成了四个单调区间,则实数a,b,c满足
- 9the best way to learn english is to use it里面2个to do
- 10my good friend
热门考点
- 14个边长是1分米的正方形无论拼成一个什么图形,其面积总是4平方分米.
- 2英语翻译
- 3什么是感应起电?原因是什么?
- 4描写秋天田野丰收的四字词语
- 5一块长方体钢材,长50cm,宽40cm,高20cm,象在把他造成底面直径是20cm高15cm的圆锥.最多能造多少个?(得数保留整数)
- 6( )the passage careful and you will understand it well.中括号内应写read还是to read
- 7一个圆的直径是8dm,半径是( )dm,周长是( )dm,面积是(
- 82010年1月24号地震?
- 9单项式-2分之1x²y²z的系数为(),次数为().
- 10一个日右边一个句底下一个四点底那个字念什么啊