1.wstringstream
wstringstream -》wstring
//数据转换
Std::wstringstream ss;
Ss << “111”;
Ss << “22”;
Std::wstring cc = ss.str;
2.ifstream 和ofstream
读写一个结构体
//要注意覆盖问题
Struct A{};
Struct A a;
ofstream out;
out.open(“temp.dat”, ios::binary);
if (!in)
{
//shibai
}
out.write(const char*(a), sizeof(Struct A));
out.close();
Struct A{};
Struct A a;
ifstream in;
in.open(“temp.dat”, ios::binary | ios::in);
if (!in)
{
//shibai
}
In.read(char*(a), sizeof(Struct A));
In.close();
1776


&spm=1001.2101.3001.11974&articleId=65713752&d=1&t=3&u=f3a1bd4d65224453954766961a3253bd)

被折叠的 条评论
为什么被折叠?



