首页 > 其他 > 详细

c fopen

时间:2014-06-07 03:01:19      阅读:349      评论:0      收藏:0      [点我收藏+]
bubuko.com,布布扣
#include <iostream>
#include <plug/plug.h>
using namespace std;
int main()
{
    int pid = GetCurrentProcessId();
    auto path = Plug::GetCurrentPath();//返回std::wstring
    path += L"test.txt";
    auto file = _wfopen(path.c_str(), L"wb");//写或者新建一个二进制文件
    char buf[10] = {0};
    itoa(pid, buf, 10);
    fwrite(buf, 6, 1, file);//arg2:单个字节数,arg3:写入的个数,arg4:目标文件指针
    fclose(file);
    getchar();
    return 0;
}
bubuko.com,布布扣

感觉没有c++fstream方便

c fopen,布布扣,bubuko.com

c fopen

原文:http://www.cnblogs.com/zzyoucan/p/3756124.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!