当前位置:网站首页>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 .
边栏推荐
- 栈应用(平衡符)
- The reasons why there are so many programming languages in programming internal skills
- 网上开户哪家证券公司佣金最低,我要开户,网上客户经理开户安全吗
- Road construction issues
- Heap structure and heap sort heapify
- 常见的几种最优化方法Matlab原理和深度分析
- [how to solve FAT32 when the computer is inserted into the U disk or the memory card display cannot be formatted]
- User and group command exercises
- Depth and breadth first traversal of tree (regardless of binary tree)
- Comprehensively develop the main channel of digital economy and digital group, and actively promote the utonmos digital Tibet market
猜你喜欢

Logback log sorting

MySQL installation, uninstallation, initial password setting and general commands of Linux

Mycms we media mall v3.4.1 release, user manual update

Complete DNN deep neural network CNN training with tensorflow to complete image recognition cases

研发团队资源成本优化实践

Golang - command line tool Cobra

AI 考高数得分 81,网友:AI 模型也免不了“内卷”!

Error running 'application' in idea running: the solution of command line is too long

Unity embeddedbrowser browser plug-in event communication

太阳底下无新事,元宇宙能否更上层楼?
随机推荐
顺序表(C语言实现)
Multi table query of MySQL - multi table relationship and related exercises
MySQL 数据增删改查综合案例
Shell timing script, starting from 0, CSV format data is regularly imported into PostgreSQL database shell script example
Resolved (error in viewing data information in machine learning) attributeerror: target_ names
Go language unit test 5: go language uses go sqlmock and Gorm to do database query mock
Golang - command line tool Cobra
Kivy教程之 如何自动载入kv文件
MySQL 数据处理值增删改
[how to solve FAT32 when the computer is inserted into the U disk or the memory card display cannot be formatted]
Record 405 questions about bank callback post request
Unity Render Streaming通过Js与Unity自定义通讯
SQL Injection (GET/Select)
Internet of things completion -- (stm32f407 connects to cloud platform detection data)
Depth and breadth first traversal of tree (regardless of binary tree)
Realize the recognition and training of CNN images, and process the cifar10 data set and other methods through the tensorflow framework
Complete deep neural network CNN training with tensorflow to complete picture recognition case 2
TensorBoard可视化处理案例简析
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
ThreadPoolExecutor realizes multi-threaded concurrency and obtains the return value (elegant and concise way)