我有一个简单的“加密”函数,它与wstring变量一起使用,我想用wofstream将此函数的结果写入文件。 这是我的代码: void save_file() {
wstring text = L"Text to be encrypted. The text is encrypted but not saved";
wstring enctext = encrypt(text)
我想写一个std::wstring到一个文件上,并且需要读取那个内容为std:wstring。当字符串为L"<Any English letter>"时,正如预期的那样发生。但是,当我们有像孟加拉语,卡纳达语,日语等任何非英文字母的字符时,问题就会发生。尝试了各种选项,如: 转换的std::wstring到std::string和写入到文件和读取时间读取为std::string,并转换为std::
我开发了一个C++应用程序,用于在随机访问文件上读取和写入数据。 (我使用Visual C++ 2010) 这里是我的程序: #include <iostream>
#include <fstream>
#include <string>
using namespace std;
class A
{
public :
int a;
string b;