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'
人气:126 ℃ 时间:2020-09-26 13:00:18
解答
#include <stdio.h>typedef struct Birthday{ short year; short month; short day;}Bir;typedef struct Student{ char name[10]; ...
推荐
- 两个长方形,它们的周长相等,甲的长与宽之比是3:2,乙的长与宽之比是7:5,则甲与乙面积之比是( ) A.3:2 B.7:5 C.864:875
- 神经纤维冲动传导的最高频率小于绝对不应期的倒数
- 用卡诺图化简逻辑函数式Z(A,B,C,D)=CD~(A异或B)+A~BC~+A~约束条件为 B+CD=0
- 六年级上册数学应用题72道
- 2003年,我国爆发了非典疫情,为了阻断非典的传播,在全国各大人口出入较多的地方安装了红外线测温仪,请你用所学知识分析一下红外线测温仪的原理(初二物理)
- 己知椭圆的焦点在X轴上,焦距为24,且椭圆上的一点到两焦点的距离之和为40,求椭圆的标准方程
- 有时候在电视看见什么东西几倍 我想问1的1倍是1还是2怎么样算 那1的2倍式多少 1的 2.5倍 又是多少
- He invited us to see a film, he himself to buy the tickets.
猜你喜欢