C
宅笔记
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Linux C之打印(printf/fprintf/errno/strerrno/perror)
fprintf / strerror / errno#include <stdio.h>#include <stdlib.h>#include <string.h>#include <errno.h>#include <libgen.h>extern int errno;#define LOG_ERROR(msg) ...原创 2019-07-13 15:28:48 · 1603 阅读 · 0 评论 -
scanf你不知道的那些用法
scanf int a,f; scanf("%2d%*2d%1d",&a,&f); printf("a=%d b=%%%d\n",a,f);运行:注释:%2d表示只接收2个字符,%*2d表示忽略2个字符,%1d表示只接收1个字符原创 2019-07-13 15:49:21 · 1835 阅读 · 0 评论 -
fopen/open/lseek/fseek/fileno 函数详解
openint open(const char *pathname, int flags, mode_t mode);flags : O_CREAT :创建文件 O_EXCL :必须和O_CREAT一起使用,表示如果文件不存在就创建,如果文件存在就失败 O_APPEND:追加 O_RDWR O_RDONLY O_RWONLY注意:创建文件时,权限会受到uma...原创 2019-07-13 16:13:08 · 745 阅读 · 0 评论 -
ftruncate函数详解
代码实例:#include <unistd.h>#include <fcntl.h>#include <stdio.h>#include <errno.h>#include <stdlib.h>#include <string.h>extern int errno;#define ERR_EXIT(msg...原创 2019-07-14 16:02:16 · 2956 阅读 · 0 评论
分享