摘要: 1.printf("%08x %08x",number, ~number); 08x:0x表示16进制;08x表示不到8位时左侧补0; 2.如果在字符串内部使用双引号,必须在双引号前面加一个反斜杠(\) 1 printf("\"Run,Spot, run!\"execlaimed Dick.\n") 阅读全文
posted @ 2020-12-03 21:49 静精进境 阅读(205) 评论(0) 推荐(0) 编辑
摘要: calloc申请的堆区内存空间是经过初始化的,全部初始化为 0; malloc申请的堆区内存空间是未经初始化的。 calloc适合为数组申请大小,参数接收两个,第一个为数组元素的数量,第二个为数组元素大小; 例程:malloc和calloc都可以实现 1 #include <stdio.h> 2 # 阅读全文
posted @ 2020-12-03 16:57 静精进境 阅读(584) 评论(0) 推荐(0) 编辑
摘要: 代码如下: 1 #include <stdio.h> 2 #include <string.h> 3 4 int main() { 5 char name[10][25]; 6 //定义接收10个名字 7 for (int i = 0; i < 10; ++i) { 8 scanf("%s", na 阅读全文
posted @ 2020-12-03 15:32 静精进境 阅读(164) 评论(0) 推荐(0) 编辑