当前位置: > 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'

提问时间: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的值和该切线方程.
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
版权所有 CopyRight © 2012-2019 超级试练试题库 All Rights Reserved.