#include <string>
#include <fstream>
static std::ofstream g_log("111111.log");//指定到out.log文件夹
std::cout.rdbuf(g_log.rdbuf());
cout中文乱码解决:
#include "stdafx.h"
#include <Windows.h>
#include <iostream>
system("chcp 65001");
std::cout<< "你好,中国"<< std::endl;
system("pause");
版权声明:本文为jacke121原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。