#include<iostream>
#include<sstream>
#include<fstream>
using namespace std;
int main()
{
int a = 1;
wstring aa = "abcdef";
//第一种方法 c++
ofstream fout("D:\\outtxt.txt");
fout<<a<<endl;
fout<<endl;
fout<<flush;
fout.close();
//第二种方法 c
FILE *fp = fopen("d:\\out.txt", "wt");
fprintf(fp, "%d\t", a);
fprintf(fp, "\n");
fprintf(fp, "%s", aa.c_str());
fclose(fp);
system("pause");
return 0;
}
c++ 打印简单log信息,输出内容到某一文件中
最新推荐文章于 2025-07-08 16:45:38 发布