当前位置:网站首页>C language standard IO function sorting
C language standard IO function sorting
2022-07-03 13:49:00 【yolo_ yyh】
Catalog
Two 、 Common standards IO function
One 、 brief introduction
common IO Functions fall into two categories , They are standard IO And system IO, The specific differences and connections are :
- Systems of different systems IO There's a difference , And the standard IO It is common to any platform ;
- standard IO Is dependent on system calls IO Realized ;
- standard IO Large throughput , file IO Fast response ;
- standard IO And documents IO Don't mix .
Two 、 Common standards IO function
FIFE *fopen(const char *path, const char *mode);
/*
path: Open file path
mode: Open file mode
*/
int fclose(FIFE *stream)
// Close the current file stream
int fgetc(FIFE *stream)
// Read a character , Returns the character converted to int Type value
int fputc(int c, FIFE *stream);
// hold c Convert to the corresponding character , writes stream in
char *fgets(char *s, int size, FIFE *stream);
// Read line breaks or EOF end , The results are saved to s in , Will save one more '\0'
int fputs(const char *s, FIFE *stream);
// hold s remove '\0' Characters other than write stream in
size_t fread(void *ptr, size_t size, size_t nmemb, FIFE *stream);
// read nmemb Elements , Each size size byte , Save to ptr in
size_t fwrite(const void *ptr, size_t size, size_t nmemb, FIFE *stream);
// Write nmemb Elements , Each size size byte , writes stream in
// File location pointer related :
int fseek(FIFE *stream, long offset, int whence)
long ftell(FIFE *stream)
void rewind(FIFE *stream)
int fflush(FIFE *stream)
// printf/scanf gens
int printf(const char *format);
int fprintf(FIFE *stream, const char *format, ...);
int sprintf(char *str, const char *format, ...); // It can be seen as atoi The inverse function of
//sprintf() May cause buffer overflow
int snprintf(char *str, size_t size, const char *format, ...);
int scanf(const char *format, ...);\
int fscanf(FILE *stream, const char *format, ...);
int sscanf(const char *str, const char* format, ...);
- fread() and fwrite() It is only suitable for reading and writing neat byte blocks ;
- fseek() and ftell It can only be used when the file size does not exceed 2G Of .
边栏推荐
- Unity Render Streaming通过Js与Unity自定义通讯
- 使用tensorflow进行完整的DNN深度神经网络CNN训练完成图片识别案例
- SVN添加文件时的错误处理:…\conf\svnserve.conf:12: Option expected
- 全面发展数字经济主航道 和数集团积极推动UTONMOS数藏市场
- Unity EmbeddedBrowser浏览器插件事件通讯
- [technology development-24]: characteristics of existing IOT communication technology
- 挡不住了,国产芯片再度突进,部分环节已进到4nm
- MySQL installation, uninstallation, initial password setting and general commands of Linux
- mysql中的字段问题
- Halcon combined with C # to detect surface defects -- Halcon routine autobahn
猜你喜欢
Logback log sorting
JVM系列——概述,程序计数器day1-1
Setting up remote links to MySQL on Linux
The shortage of graphics cards finally came to an end: 3070ti for more than 4000 yuan, 2000 yuan cheaper than the original price, and 3090ti
8皇后问题
[understanding by chance-37]: the structure of human sensory system determines that human beings are self-centered
使用tensorflow进行完整的DNN深度神经网络CNN训练完成图片识别案例
[technology development-24]: characteristics of existing IOT communication technology
MyCms 自媒体商城 v3.4.1 发布,使用手册更新
[技术发展-24]:现有物联网通信技术特点
随机推荐
Complete DNN deep neural network CNN training with tensorflow to complete image recognition cases
SwiftUI 开发经验之作为一名程序员需要掌握的五个最有力的原则
[technology development-24]: characteristics of existing IOT communication technology
Go language web development series 27: Gin framework: using gin swagger to implement interface documents
SQL Injection (GET/Select)
Libuv Library - Design Overview (Chinese version)
Spark实战1:单节点本地模式搭建Spark运行环境
Flutter dynamic | fair 2.5.0 new version features
使用tensorflow进行完整的DNN深度神经网络CNN训练完成图片识别案例
Go language unit test 4: go language uses gomonkey to test functions or methods
Another industry has been broken by Chinese chips. No wonder the leading analog chip companies in the United States have cut prices and sold off
Go language web development series 30: gin: grouping by version for routing
Spark practice 1: build spark operation environment in single node local mode
Golang — template
静态链表(数组的下标代替指针)
[技術發展-24]:現有物聯網通信技術特點
ThreadPoolExecutor realizes multi-threaded concurrency and obtains the return value (elegant and concise way)
Unable to stop it, domestic chips have made another breakthrough, and some links have reached 4nm
Internet of things completion -- (stm32f407 connects to cloud platform detection data)
Go language web development series 28: solve cross domain access of CORS with gin contrib / CORS