程序的运行结下面果是( )。 #include #include int main(void) { char *s1="AbDeG"; char *s2="AbdEg"; s1+=2; s2+=2; printf("%d\n",strcmp(s1,s2)); return 0; }
A. 正数
B. 负数
C. 0
D. 不确定的值
查看答案
已定义以下函数fun(int *p) { return *p; } 该函数的返回值是( )。
A. 不确定的值
B. p中存放的值
C. p所指存储单元中的值
D. p的地址值
若系统为int类型分配2个字节,char类型分配1个字节,double类型分配8个字节,则如有以下说明语句,则变量ss所占内存的字节数为( )。 struct s { int m; char c; double d; }ss;
A. 8
B. 1
C. 11
D. 2
已知学生记录描述为: struct student { int no; char name[20]; char sex; struct { int year; int month; int day; }birth; } struct student s; 设变量s中的“生日”应是“1984年11月11日”,下列对“生日”的正确赋值方式是( )。
A. year=1984 month=11; day=11;
B. birth.year=1984; birth.month=11; birth.day=11;
C. s.year=1984; s. month=11; s.day=11;
D. s.birth.year=1984; s.birth.month=11; s.birth.day=11;
以下程序的输出结果是______ # include void main() { char *s1,*s2,m; s1=s2=(char*)malloc(sizeof(char)); *s1=15; *s2=20; m=*s1+*s2; printf("%d\n",m); }