![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
c
花椒酱不吃花椒喵
这个作者很懒,什么都没留下…
展开
-
c(1)标准输出+时间函数
格式说明由“%”和格式字符组成,如%d%f等。它的作用是将输出的数据转换为指定的格式输出。格式说明总是由“%”字符开始的。 格式字符有d,o,x,u,c,s,f,e,g等。 如%d整型输出,%ld长整型输出,%o以八进制数形式输出整数,%x以十六进制数形式输出整数,或输出字符串的地址。%u以十进制数输出unsigned型数据(无符号数)。注意:%d与%u有无符号的数值范围,也就是极限的值...原创 2018-05-25 07:32:44 · 415 阅读 · 0 评论 -
c(2)文件操作库函数+可变长参数表
<stdio.h>1)fopen,fclose//01fopen.c#include <stdio.h> int main(void){ FILE *fp=NULL; fp=fopen("file.c","w");//打开只写文件,不存在则新建 if(fp==NULL){ return -1; } fclose(fp)...原创 2018-05-26 16:16:55 · 311 阅读 · 0 评论 -
c(3)内存映射+文件操作系统函数
1)内存映射//01mmap.c//内存映射的建立与解除 #include <stdio.h> #include <sys/mman.h> #include <string.h> #include <stdlib.h> int main(){ char *p=(char*)mmap(NULL,8192,PROT_READ|PROT_WRITE...原创 2018-05-27 15:09:21 · 1042 阅读 · 0 评论 -
c(4)文件锁+进程
1)文件锁为了避免在读写同一个文件的同一个区域时发生冲突,进程之间应该遵循以下规则:如果一个进程正在写,那么其他进程既不能写也不能读;如果一个进程正在读,那么其他进程不能写但是可以读。2)文件元数据(文件属性信息)//node.c输出:-rrSr-rr--#include <stdio.h> #include <sys/stat.h> #include <fcntl....原创 2018-06-01 12:58:17 · 363 阅读 · 0 评论 -
c(5)进程的信号处理
1)信号处理捕获信号//sig.c输出:^C3811进程:收到2信号#include <stdio.h> #include <signal.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> //定义信号处理函数 void sigint(int signum){ p...原创 2018-06-02 10:26:42 · 284 阅读 · 0 评论