摘要: 16位系统int类型长度为2字节 32位系统int类型长度为4字节 例如: 在16位系统中,存储端口号需要用uint类型(unsigned int),范围0~65535,打印输出时可用"%u"或“%lu”。 32系统使用int或uint类型均可。 考虑到通用性可使用long型,该类型在16位和32位 阅读全文
posted @ 2022-09-03 09:18 小小宅138 阅读(846) 评论(0) 推荐(0)
摘要: 先贴代码 1 #include <stdio.h> 2 #include <string.h> 3 unsigned char buf[5] = {'a','b','c','d','\0'}; 4 int main() 5 { 6 memmove(buf+1,buf,3); 7 printf("%s 阅读全文
posted @ 2022-06-11 16:43 小小宅138 阅读(539) 评论(0) 推荐(0)
摘要: 第一个C代码是这样的: 1 #include <stdio.h> 2 int main() 3 { 4 printf("Hello, world!"); 5 return 0; 6 } “#include”是C语言的预处理指令,预处理指令一般以 “#” 开头。 “stdio.h”为头文件,是C语言的 阅读全文
posted @ 2022-06-11 00:04 小小宅138 阅读(442) 评论(0) 推荐(0)