c语言的读写函数,定位函数,错误函数

 本文的所有函数均出自stdio.h文件里

一.以下是c里面可以 进行读的函数

1.格式化输入:

scanf ();  int  scanf (const char*, ...);

fscanf();        int  fscanf (FILE*, const char*, ...);

sscanf();  int  sscanf (const char*, const char*, ...);

 

2.字符化输入:

fgetc(); int  fgetc (FILE*);

fgets(); char*  fgets (char*, int, FILE*);

  gets(); char*  gets (char*);

 

  ungetc(); int  ungetc (int, FILE*);

 

 

3.用库函数:

getc(); int  getc (FILE*);

getchar(); int  getchar (void);

4.直接输入:

 

fread(): size_t  fread (void*, size_t, size_t, FILE*);

 

 

 

 

二.以下是c里面可以进行写的函数

1. 格式化输出:

printf(); int  printf (const char*, ...);

fprinft();  int  fprintf (FILE*, const char*, ...);

sprintf();   int  sprintf (char*, const char*, ...);

 

2.字符化输出:

fputc();            int  fputc (int, FILE*);

  fputs(); int  fputs (const char*, FILE*);

puts(); int  puts (const char*);

 

3.用库函数输出:

 

putchar(); int putchar (int);

putc(); int putc (int, FILE*);

 

4.直接输出:

fwrite(); size_t  fwrite (const void*, size_t, size_t, FILE*);

 

 

 

 

三. 文件定位函数:

fseek();   int l fseek (FILE*, long, int);

ftell();   long  ftell (FILE*);

rewind(): void  rewind (FILE*);

 

fgetpos():   int  fgetpos (FILE*, fpos_t*);

fsetpos():   int  fsetpos (FILE*, const fpos_t*);

 

 

 

四. 错误函数:

feof():   int feof (FILE*); ferror(): int ferror (FILE*);

clearerr():  void clearerr (FILE*); perror(): void perror (const char*);

 

 

 

 

 

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值