std::ios_base::ate(例如std::ios_base::app除外)和std::的意义何在ios_base::trunc(例如std::ios_base::out除外)?我应该更喜欢写std::ios_base::smth而不是std::ios::smth? 最佳答案 std::ios_base::ate将光标定位在文本的末尾,而std::ios_base_app在末尾附加文本(带有写操作),尽管您仍然可以从头开始阅读:)std::ios_base::trunc截断文件,使其被清空,而std::ios_base::o