Questions
Questions
241
2.
3、
printf("%d %d\n",sizeof(str1),sizeof(str2));
4、
int a = 3, b = 2, c= 1;
if(a>b)
a=c;
else;
c=b;
if(a=b)
b=c;
else
b=3;
5.
c = a + b;
d = b - a;
___,____,____
6、
is 0x8000
____,___,___
7.
int x = 10;
test_fun()
x++;
return;
void main()
int x = 3;
test_fun();
x--;
printf("x = %d.\n",x);
return;
}
x=
c = ___ d = ____
9、
char array2[2][5]={"abcde","1234"};
10、
2));
11、
printf("%s.\n",str3);
a = 7 ^ 3;
b = 3 <<2;
c = ~1;
int area=S(3+1,3+4);
C. float type variable can not add with char type variable
16、
void main(void)
char*s = "hello";
char ch='a';
return;
sizeof(s) = ______
statements
char * const p; ______
18、
int x = 3, y = 2, z = 3;
19、
struct Test1
int b;
double c;
long d;
}data, *p;
returns an integer
21、
p1 + 5 =______
p2 + 5 =______
22、
void main(void)
int a[5]={1,2,3,4,5};
int * ptr=(int*)(&a+1);
printf(“%d,%d”,*(a+1),*(ptr-1));
return;
23.
24.
int main(void)
return 0;
____,___,___
25.
int main(void) {
printf("%5s,%.5s,%5.6s\n",str1,str1,str1);
printf("%5s,%.5s,% 5.6s\n",str2,str2,str2);
printf("%5s,%.5s,%5.6s\n",str3,str3,str3);
return 0;
short a;
char b;
long long c;
char d;
}data;
int main(void) {
printf("%d\n",sizeof(data));
return 0;
_____
struct AA{
int a;
char b;
short c;
char d;
};
struct BB{
struct AA a;
char b;
char c;
int d;
};
#pragma pack(2)
struct CC{
char a;
struct BB b;
char c;
int d;
};
#pragma pack()
#pragma pack(1)
struct DD {
char a;
short b;
struct CC c;
char d;
};
int main()
{ struct AA w;
struct BB x;
struct CC y;
struct DD z;
}
____,____,____,____
28.
____,____,____,____,___.
29.
30.
printf("%s %s %s %c\n",*p2,p2+1,*p2+1,*p3);
____,____,___,____
31.
printf("%d\n", sizeof(array));
printf("%s %s %c %c\n",*p1+2,*(p1+2),**p1+2,**(p1+2));
_____,_____,_____,____,____,____
33.
enum Weekday {
Sunday,
Monday,
Tuesday,
Wednesday,
Thursday = 10,
Friday,
Saturday
};
int main() {
today = Saturday;