只需一步,快速开始
使用道具 举报
The ios::nocreate setting did not make it into the ISO 14882:1998 C++ standard. Too platform specific. You can simulate that behavior with: fstream foo("foo.txt", ios_base::in); if(!fs) { // File does not exist. // Do not create one. } else { foo.close(); foo.open("foo.txt", ios_base:ut); }
Table 13.33. Meaning of Open Modes in C++ ios_base Flags Meaning CMode in Reads (file must exist) "r"
本版积分规则 发表回复 回帖并转播 回帖后跳转到最后一页
GMT+8, 2024-11-6 07:42 , Processed in 0.043759 second(s), 16 queries .
© 2021 Powered by Discuz! X3.5.