当前位置:网站首页>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 .
边栏推荐
- [understanding by chance-37]: the structure of human sensory system determines that human beings are self-centered
- Can newly graduated European college students get an offer from a major Internet company in the United States?
- Go language unit test 5: go language uses go sqlmock and Gorm to do database query mock
- untiy世界边缘的物体阴影闪动,靠近远点的物体阴影正常
- Kivy tutorial how to automatically load kV files
- [sort] bucket sort
- 8皇后问题
- JS 将伪数组转换成数组
- The shadow of the object at the edge of the untiy world flickers, and the shadow of the object near the far point is normal
- Asp. Net core1.1 without project JSON, so as to generate cross platform packages
猜你喜欢

SQL Injection (AJAX/JSON/jQuery)
![[quantitative trading] permanent portfolio, turtle trading rules reading, back testing and discussion](/img/3b/28327bbf5eb19254f03500a41e2adb.jpg)
[quantitative trading] permanent portfolio, turtle trading rules reading, back testing and discussion

8皇后问题

刚毕业的欧洲大学生,就能拿到美国互联网大厂 Offer?

Internet of things completion -- (stm32f407 connects to cloud platform detection data)

MySQL functions and related cases and exercises

Go language web development series 30: gin: grouping by version for routing

【BW16 应用篇】安信可BW16模组与开发板更新固件烧录说明

SQL Injection (GET/Select)

Logback log sorting
随机推荐
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
Complete deep neural network CNN training with tensorflow to complete picture recognition case 2
PHP maze game
[technology development-24]: characteristics of existing IOT communication technology
Kivy tutorial how to automatically load kV files
PhpMyAdmin stage file contains analysis traceability
Setting up remote links to MySQL on Linux
实现CNN图像的识别和训练通过tensorflow框架对cifar10数据集等方法的处理
The R language GT package and gtextras package gracefully and beautifully display tabular data: nflreadr package and gt of gtextras package_ plt_ The winloss function visualizes the win / loss values
Unity EmbeddedBrowser浏览器插件事件通讯
Kivy教程之 如何通过字符串方式载入kv文件设计界面(教程含源码)
[技术发展-24]:现有物联网通信技术特点
AI 考高数得分 81,网友:AI 模型也免不了“内卷”!
pytorch 载入历史模型时更换gpu卡号,map_location设置
Asp.Net Core1.1版本没了project.json,这样来生成跨平台包
ThreadPoolExecutor realizes multi-threaded concurrency and obtains the return value (elegant and concise way)
双向链表(我们只需要关注插入和删除函数)
Can newly graduated European college students get an offer from a major Internet company in the United States?
Leetcode-1175.Prime Arrangements
Golang - command line tool Cobra