#include <stdio.h>
#include <string.h>

int main(){
    FILE *pFile;
    char buffer[1024];

    pFile = fopen( "target.txt", "r" );
    if ( NULL == pFile ){
        printf( "Open failure" );
        return 1;
    }else{
        fread( buffer, 1024, 1, pFile );
        printf( "%s", buffer );
    }

    fclose(pFile);
    return 0;
}

 

read  read.c  target.txt  (3 files)

 

相關文章

[ C ] 開檔、寫檔 fopen() fwrite() 

arrow
arrow
    文章標籤
    read C gcc 讀檔 程式碼
    全站熱搜

    S 發表在 痞客邦 留言(0) 人氣()