随笔分类 -  C开发

小白学C
摘要:强制类型转换 -#include<stdio.h> int main(void) { int mice; mice=(int)1.6+(int)1.7; printf("Mice=%d\n",mice); return 0; } 带参数函数 -#include<stdio.h> void pound 阅读全文
posted @ 2021-03-18 09:34 菲阳公社 阅读(98) 评论(0) 推荐(0)
摘要:* -#include<stdio.h> int main(void) { unsigned int width; int num=256; printf("What filed width?\n"); scanf("%d",&width); printf("The number is %*d\n" 阅读全文
posted @ 2021-03-12 15:16 菲阳公社 阅读(96) 评论(0) 推荐(0)
摘要:输入 -#include<stdio.h> int main(void) { int age; printf("Please enter your age: \n"); scanf("%d",&age);//读取第一个非空数字,到下一个空字符截止 printf("your age is %d\n", 阅读全文
posted @ 2021-03-12 13:40 菲阳公社 阅读(142) 评论(0) 推荐(0)
摘要:重要的设备文件 1./dev/console:系统控制台,错误信息和诊断信息通常会发到这个设备 2./dev/tty:如果一个进程有控制终端的话,那么他就是这个控制终端的别名 3./dev/null:文件为空的设备 系统调用和驱动程序 1.系统调用:对文件和设备进行访问和控制的函数 2.操作系统的核 阅读全文
posted @ 2021-03-09 11:40 菲阳公社 阅读(86) 评论(0) 推荐(0)
摘要:## Scanf -- scanf()会在遇到第一个空白字符空格、制表符或者换行符处停止读取。 #include<stdio.h> #define PRAISE "What a super marvelous name!" int main(void){ char name[40]; printf( 阅读全文
posted @ 2021-03-09 11:37 菲阳公社 阅读(69) 评论(0) 推荐(0)
摘要:格式宽度 -#include<stdio.h> -#define PAGES 931 int main(void) { printf("%d\n",PAGES); printf("%2d\n",PAGES); //自动扩展 printf("%10d\n",PAGES); //又对齐 printf(" 阅读全文
posted @ 2021-03-09 11:36 菲阳公社 阅读(354) 评论(0) 推荐(0)