file.hpp

概要
プロトタイプ宣言動作説明
bool fopen(FILE** fp, const char* FileName, const char* mode);                              ファイルを開く                           
使用例
#include <sstd/sstd.hpp>

int main(){
    FILE* fp;
    const char* FileName = "./test_fopen.txt";

    if(!sstd::fopen(&fp, FileName, "wb")){ // Enable to open file by the same code between MSVC++ and GCC.
        // falied
        printf("false\n\n");
    }else{
        // success
        printf("example.txt was made.\n\n");
        std::string buf="abc";
        fwrite(buf.c_str(), 1, buf.size(), fp);
        fclose(fp);
    }
}

実行結果
$ ./exe.exe
example.txt was made.
実装

0 件のコメント:

コメントを投稿