首页 | 嵌入式系统 | 显示技术 | 模拟IC/电源 | 元件与制造 | 其他IC/制程 | 消费类电子 | 无线/通信 | 汽车电子 | 工业控制 | 医疗电子 | 测试测量
首页> 分享下载> 消费类电子> 常见题型

常见题型

资料介绍
常见(1). 假定在所有的程序中必须的头文件都已经被正确包含,考虑如下的数据类型: char 为 1 个字节,int 为 4 个字节,long int 为 4 个字节,float 为 4 个字节,double 为个 8 字节,long double 为 8 个字节,指针为 4 个字节 1. Consider the following program: #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); } The output for this program is: (a) 3 (b) 5 (c) 0 (d) None of the above The answer is (b) volatile variable isn't affected by the optimization. Its value after the longjump is the last value variable assumed. b last value is 5 hence 5 is printed. setjmp : Sets up for nonlocal goto /* setjmp.h*/ Stores context information such as register values so that the lomgjmp function can return control to the statement following the one calling setjmp.Returns 0 when it is initially cal
标签: 常见
常见题型
本地下载

评论