2016-10-22 00:00:00嘉辉 嵌入式培训
第1题: 考查对volatile关键字的认识
#include
static jmp_buf buf;
main()
{
volatile int b;
b =3;
if(setjmp(buf)!=0)
{
printf("%d ", b);
exit(0);
}
b=5;
longjmp(buf , 1);
}
请问, 这段程序的输出是
(a) 3
(b) 5
(c) 0
(d) 以上均不是
第2题:考查类型转换
main()
{
struct node
{
int a;
int b;
int c;
};
struct node s= { 3, 5,6 };
struct node *pt = &s;
printf("%d" , *(int*)pt);
}
这段程序的输出是:
(a) 3
(b) 5
(c) 6
(d) 7
第3题:考查递归调用
int foo ( int x , int n)
{
int val;
val =1;
if (n>0)
{
if (n%2 == 1) val = ..........
阅读全文871
人