2025年7月16日

摘要: 2 解引用 #include <stdio.h> int main() { static int a[5] = {1, 2, 3, 4, 5}; int b = 6; int *p = (int *)((int*)&a + 1); printf("*(a + 1) = %d\n", *(a + 1) 阅读全文
posted @ 2025-07-16 16:59 boluke龙 阅读(5) 评论(0) 推荐(0)
 
摘要: 下面哪种同步机制不能在中断上下文使用 (D) 自旋锁 原子操作 内存屏障信号量 信号量 解答: 中断上下文是执行中断处理程序的特殊环境,禁止发生睡眠操作,而信号量/互斥量可能会导致睡眠,因此不能在中断上下文中使用,选择选项 D 五种进程间通信:匿名管道;信号量;共享内存;套接字;消息队列 有如下一段 阅读全文
posted @ 2025-07-16 15:32 boluke龙 阅读(5) 评论(0) 推荐(0)
 
摘要: 填空题】某计算机的主频为 4MHz,各类指令的平均执行时间和使用频度如下表所示,则该机的MIPS 为 () ,CPI 为 () 指令类别 存取 加、减、比较、转移 乘除 其他 平均指令执行时间 1.0us 0.5us 10us 2.5us 使用频度 30% 40% 10% 20% 1. 计算各类指令 阅读全文
posted @ 2025-07-16 15:23 boluke龙 阅读(12) 评论(0) 推荐(0)
 
摘要: 【不定项选择题】以下对二维数组的定义中正确的是 (C) int a[4][]={1,2,3,4,5,6}; int a[][3]; int a[][3]={1,2,3,4,5,6}; int a[][]={{1,2,3},{4,5,6}}; 解答: 缺少第二维大小,无法确定型状,选项 A 错误 缺少 阅读全文
posted @ 2025-07-16 14:30 boluke龙 阅读(6) 评论(0) 推荐(0)
 
摘要: 1 What's the output of following code (B) #include <stdio.h> #include <stdint.h> uint32_t a = 10; void func(uint32_t **out) { *out = &a; a = 20; } int 阅读全文
posted @ 2025-07-16 12:52 boluke龙 阅读(11) 评论(0) 推荐(0)
 
摘要: Suppose running on Linux, which one is the correct output of following code (C) #include <stdio.h> void test1(void) { char* my_array = "abc"; my_array 阅读全文
posted @ 2025-07-16 10:16 boluke龙 阅读(14) 评论(0) 推荐(0)