当前位置:网站首页>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 .
边栏推荐
- 编程内功之编程语言众多的原因
- 刚毕业的欧洲大学生,就能拿到美国互联网大厂 Offer?
- Multi table query of MySQL - multi table relationship and related exercises
- json序列化时案例总结
- Disruptor -- a high concurrency and high performance queue framework for processing tens of millions of levels
- 常见的几种最优化方法Matlab原理和深度分析
- The solution of Chinese font garbled code in keil5
- [redis] cache warm-up, cache avalanche and cache breakdown
- IBEM 数学公式检测数据集
- Replace the GPU card number when pytorch loads the historical model, map_ Location settings
猜你喜欢

全面发展数字经济主航道 和数集团积极推动UTONMOS数藏市场

双向链表(我们只需要关注插入和删除函数)
![[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

RichView TRVStyle ListStyle 列表样式(项目符号编号)
![[today in history] July 3: ergonomic standards act; The birth of pioneers in the field of consumer electronics; Ubisoft releases uplay](/img/18/b06e2e5a2f76dc2da1c2374b8424b3.png)
[today in history] July 3: ergonomic standards act; The birth of pioneers in the field of consumer electronics; Ubisoft releases uplay

Typeerror resolved: argument 'parser' has incorrect type (expected lxml.etree.\u baseparser, got type)
![[技術發展-24]:現有物聯網通信技術特點](/img/f3/a219fe8e7438b8974d2226b4c3d4a4.png)
[技術發展-24]:現有物聯網通信技術特點

The principle of human voice transformer

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
![[sort] bucket sort](/img/52/95514b5a70cea75821883e016d8adf.jpg)
[sort] bucket sort
随机推荐
Error handling when adding files to SVN:.... \conf\svnserve conf:12: Option expected
Logback log sorting
Open PHP error prompt under Ubuntu 14.04
MapReduce实现矩阵乘法–实现代码
[556. Next larger element III]
logback日志的整理
Go language web development series 27: Gin framework: using gin swagger to implement interface documents
Mastering the cypress command line options is the basis for truly mastering cypress
Swiftui development experience: the five most powerful principles that a programmer needs to master
Flutter动态化 | Fair 2.5.0 新版本特性
Multi table query of MySQL - multi table relationship and related exercises
Setting up remote links to MySQL on Linux
记录关于银行回调post请求405 问题
Kivy教程之 如何通过字符串方式载入kv文件设计界面(教程含源码)
Which securities company has the lowest Commission for opening an account online? I want to open an account. Is it safe for the online account manager to open an account
SQL Injection (POST/Search)
IBEM mathematical formula detection data set
服务器硬盘冷迁移后网卡无法启动问题
SQL Injection (GET/Search)
使用tensorflow进行完整的DNN深度神经网络CNN训练完成图片识别案例