zoukankan      html  css  js  c++  java
  • C语言文件读取和写入

    打开文件

    FILE *fopen(const char *filename, const char *mode)

    关闭文件

    int fclose(FILE *stream)

    读取字符

    int getc(FILE *stream)

    写入字符

    int putc(int char, FILE *stream)

    fprintf

    int fprintf(FILE *stream, const char *format, ...)

    fscanf

    int fscanf(FILE *stream, const char *format, ...)

    fputs

    int fputs(const char *str, FILE *stream)

    fgets

    char *fgets(char *str, int n, FILE *stream)

    fseek

    int fseek(FILE *stream, long int offset, int whence)
    SEEK_SET Beginning of file
    SEEK_CUR Current position of the file pointer
    SEEK_END End of file

    ftell

    long int ftell(FILE *stream)

    ffush

    long int ftell(FILE *stream)

    fread

    size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream)

    fwrite

    size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)

    有了计划记得推动,不要原地踏步。
  • 相关阅读:
    codevs1004 四子连棋
    codevs1009 产生数
    NOIP2014 寻找道路
    Tyvj1139 向远方奔跑(APIO 2009 抢掠计划)
    随机算法
    线性基
    线性基入门
    线性基 + 并查集
    欧拉公式 (平面)
    卡特兰数 + 大数
  • 原文地址:https://www.cnblogs.com/amnotgcs/p/15731077.html
Copyright © 2011-2022 走看看