标签:c style class blog code java
#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; }
感觉没有c++fstream方便
标签:c style class blog code java
原文地址:http://www.cnblogs.com/zzyoucan/p/3756124.html