如有以下说明和定义,则会发生的情况是()。struct abc { int x; char y; }struct abc s1, s2;
A. 编译出错
B. 程序将顺利编译、连接和执行
C. 能顺利通过编译、连接,但不能执行
D. 能顺利通过编译,但是连接出错
查看答案
已知有描述学生信息的结构体如下,则对学生生日赋值正确的是()。struct student{int num;char name[20];struct{int year;int month;int day;}birth;};struct student s ;
A. year=2019month=11day=12
B. birth.year=2019birth.month=11birth.day=12
C. s.year=2019s.month=11s.day=12
D. s.birth.year=2019s.birth.month=11s.birth.day=12
设有以下定义:则下列叙述中正确的是()。typedef struct example{char c;int a[4];}EX;
A. 可以用example定义结构体变量
B. example是struct类型的变量
C. 可以用EX定义结构体变量
D. EX是struct example类型的变量
若要打开D盘上user子目录下名为”abc.txt”的文本文件进行又读又写操作,下面符合此要求的函数调用是()。
A. fopen(“D:\user\abc.txt”,"r”)
B. fopen(“D:\\user\\abc.txt”,"r+”)
C. fopen(“D:\user\abc.txt”,"rb”)
D. fopen(“D:\\user\\abc.txt”,"w”)
fscanf()函数的正确调用形式是
A. fscanf(格式字符串,输入表列首地址表);
B. fscanf(格式字符串,输入表列首地址表,fp);
C. fscanf(格式字符串,文件指针,输入表列首地址表);
D. fscanf(文件指针,格式字符串,输入表列首地址表);