• 标准IO函数


     #include <stdio.h>
     
           FILE *fopen(const char *path, const char *mode);
           
    The fopen() function opens the file whose name is the string pointed to by path and associates a stream with it.
            
              int fclose(FILE *fp);
     
    打开标准I/O流的mode参数
     
     
     
    SYNOPSIS
           #include <stdio.h>
     
           size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream);
     
           size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream);
     
    DESCRIPTION
           The  function  fread()  reads  nmemb  elements of data, each size bytes
           long, from the stream pointed to by stream, storing them at  the  loca‐
           tion given by ptr.
     
           The  function  fwrite()  writes nmemb elements of data, each size bytes
           long, to the stream pointed to by stream, obtaining them from the loca‐
           tion given by ptr.
    RETURN VALUE
           fread()  and  fwrite()  return the number of items successfully read or
           written (i.e., not the number of characters).  If an error  occurs,  or
           the  end-of-file is reached, the return value is a short item count (or
           zero).
     
    #include <stdio.h>
     
           int fgetc(FILE *stream);
     
           char *fgets(char *s, int size, FILE *stream);
     fgetc() reads the next character from  stream  and  returns  it  as  an
           unsigned char cast to an int, or EOF on end of file or error.
     
     fgets() reads in at most one less than size characters from stream  and
           stores  them  into  the buffer pointed to by s.  Reading stops after an
           EOF or a newline.  If a newline is read, it is stored into the  buffer.
           A  terminating  null  byte ('') is stored after the last character in
           the buffer.
     
     #include <stdio.h>
     
           int fputc(int c, FILE *stream);
     
           int fputs(const char *s, FILE *stream);
        fputc() writes the character c, cast to an unsigned char, to stream.
        fputs()  writes  the  string  s to stream, without its terminating null
           byte ('').
     
     #include <stdio.h>
     
           int fseek(FILE *stream, long offset, int whence);
     
      The  fseek()  function  sets the file position indicator for the stream
           pointed to by stream.  The new position, measured in bytes, is obtained
           by  adding offset bytes to the position specified by whence.  If whence
           is set to SEEK_SET, SEEK_CUR, or SEEK_END, the offset  is  relative  to
           the  start of the file, the current position indicator, or end-of-file,
           respectively.  A successful call to the  fseek()  function  clears  the
           end-of-file  indicator  for  the  stream  and undoes any effects of the
           ungetc(3) function on the same stream.
     
  • 相关阅读:
    搭建VirtoCommerce2.6开发环境,同官方dev分支保持同步(上)
    VirtoCommerce中文博客站,2015年11月18日上线了!
    C#编程连接数据库,通过更改配置文件切换数据库功能。
    浅谈dataGridView使用,以及画面布局使用属性,对datagridview进行增删改查操作,以及委托使用技巧
    将listBox中信息显示在dataGridview中,操作datagridview后删除listBox信息和SQL数据库信息 续(浅谈listBox..)
    for语句嵌套使用 实现9*9乘法表
    浅谈ListBox控件,将对象封装在listBox中,在ListBox中显示对象中某个属性,在ListBox中移除和移动信息
    使用SignalR为FineUI/Webform打造消息总线
    封装一个错误重试类
    封装一个锁处理类
  • 原文地址:https://www.cnblogs.com/smile-at-you/p/3359231.html
Copyright © 2020-2023  润新知