上一页 1 ··· 287 288 289 290 291 292 293 294 295 ··· 408 下一页
摘要: 1、测试数据 [root@centos7 test]# cat a.txt 1 2 3 4 5 6 7 8 9 2、 数字的作用相当于print? [root@centos7 test]# cat a.txt 1 2 3 4 5 6 7 8 9 [root@centos7 test]# awk '{ 阅读全文
posted @ 2021-07-29 12:41 小鲨鱼2018 阅读(175) 评论(0) 推荐(0)
摘要: 1、c语言中如何创建、存储、输出字符串、输出字符串的大小、字符串的长度 #include <stdio.h> #include <string.h> int main(void) { char name[128]; //使用数组存储字符串 int size, len; printf("please 阅读全文
posted @ 2021-07-29 00:26 小鲨鱼2018 阅读(1143) 评论(0) 推荐(0)
摘要: 1、查看系统 [root@centos8pc2 network-scripts]# hostnamectl Static hostname: centos8pc2 Icon name: computer-vm Chassis: vm Machine ID: f021cde3a91b4a2688dbe 阅读全文
posted @ 2021-07-28 19:52 小鲨鱼2018 阅读(2630) 评论(0) 推荐(0)
摘要: #include <stdio.h> int main(void) { int ch; printf("please input an number for char type: "); scanf("%d", &ch); printf("%d is equivalent to %c.\n", ch 阅读全文
posted @ 2021-07-27 23:29 小鲨鱼2018 阅读(33) 评论(0) 推荐(0)
摘要: 1、 #include <stdio.h> #include <float.h> #include <limits.h> int main(void) { int big_int = 2147483647; float big_float = 3.4E38; float small_float = 阅读全文
posted @ 2021-07-27 23:26 小鲨鱼2018 阅读(61) 评论(0) 推荐(0)
摘要: 1、c语言中如何处理整数值的上溢。 #include <stdio.h> int main(void) { int i; int j = 1; for(i = 1; i <= sizeof(int) * 8 - 1; i++) { j *= 2; } printf("j = %d.\n", j - 阅读全文
posted @ 2021-07-27 22:36 小鲨鱼2018 阅读(582) 评论(0) 推荐(0)
摘要: 由于c语言中数据类型实际所占存储位数和精度和具体平台相关,c语言的规范并没有强制和详细的规定, 因此c语言程序在移植过程中可能会出现不同平台数据类型不兼容 的状况。 为了解决这个问题,c语言在可移植类型stdint.h和inttype.h中规定了精确宽度整数类型,以确保c语言的类型在各系统内功能相同 阅读全文
posted @ 2021-07-26 23:30 小鲨鱼2018 阅读(356) 评论(0) 推荐(0)
摘要: c语言中使用sizeof()输出各种数据类型的大小。 #include <stdio.h> int main(void) { printf("short: %zd.\n", sizeof(short)); printf("int: %zd.\n", sizeof(int)); printf("lon 阅读全文
posted @ 2021-07-26 23:05 小鲨鱼2018 阅读(4571) 评论(0) 推荐(0)
摘要: c语言中浮点数的声明与输出。 [root@centos79 test]# cat test2.c #include <stdio.h> int main(void) { float f = 1000.0; double d = 1000.0; long double ld = 1000.0; pri 阅读全文
posted @ 2021-07-26 22:52 小鲨鱼2018 阅读(513) 评论(0) 推荐(0)
摘要: char类型用于存储字符(比如字母或者标点),但是从技术层面讲,char类型是整数,因为char类型存储的是整数而不是字符。 计算机使用字符编码来处理字符,即 用特定的整数来表示特定的字符。 例如在ASCII编码中, 大写字母A存储的是65. char类型通常被定义为8位的存储单元。 通常1个字节被 阅读全文
posted @ 2021-07-26 22:31 小鲨鱼2018 阅读(9503) 评论(0) 推荐(0)
上一页 1 ··· 287 288 289 290 291 292 293 294 295 ··· 408 下一页