因此,我有一个班子。
class MySuperClass {
public:
std::string buffer;
};
And wants to print buffer
to std::cout
.
Here s some code about filling string from a file:
MySuperClass msc;
std::fstream file("./favicon.ico", std::fstream::in | std::fstream::binary);
if (file.is_open()) {
std::stringstream ss;
while (!file.eof())
ss << static_cast<uint8_t>(file.get());
msc.buffer.assign(ss.str());
file.close();
}
当我产出扼杀时,所有ok。 它印刷了幻灯,但有些是。 但当我打电话到<代码>c_str(>>>>>>