随笔分类 -  C

摘要:#include <stdio.h> int main(void) { char* i = (char*)0x1111; printf("size = %d %d\n", sizeof(i), sizeof((char*)0x11)); // size i = 8 bytes, size(char* 阅读全文
posted @ 2024-06-18 15:06 stitchCat 阅读(8) 评论(0) 推荐(0)
摘要:// Online C compiler to run C program online #include <stdio.h> typedef union { char c; int i; }u_t; int main() { u_t u; u.c = 1; printf("u.c = %d, si 阅读全文
posted @ 2024-06-18 14:43 stitchCat 阅读(13) 评论(0) 推荐(0)
摘要:// Online C compiler to run C program online #include <stdio.h> typedef struct bits { unsigned char b0 : 1; unsigned char b1 : 1; unsigned char b2 : 1 阅读全文
posted @ 2024-06-18 14:34 stitchCat 阅读(16) 评论(0) 推荐(0)
摘要:// Online C compiler to run C program online #include <stdio.h> int main() { int arr[3] = {1, 2, 3}; printf("addr of arr : %p\n", arr); printf("&arr o 阅读全文
posted @ 2024-06-08 22:21 stitchCat 阅读(9) 评论(0) 推荐(0)
摘要:Reference: 条件编译指令(符号),C语言条件编译指令完全攻略 阅读全文
posted @ 2024-05-13 11:02 stitchCat 阅读(9) 评论(0) 推荐(0)
摘要:reference: Compilation Steps and Memory Layout of the C Program Storage Class RAM明明断电会丢失数据,为什么初始化的全局变量存储在RAM?详细分析程序的存储 Memory Layout in C Memory Layou 阅读全文
posted @ 2024-04-26 18:04 stitchCat 阅读(38) 评论(0) 推荐(0)
摘要:References: Compilation Steps and Memory Layout of the C Program Table of Contents Table of Contents What are the four stages of the compilation proce 阅读全文
posted @ 2024-04-26 16:31 stitchCat 阅读(60) 评论(0) 推荐(0)