6 Write programs 1 Open the file Douttxt for writing using ctors of ofstream; 2 Open the file xjson for reading using ifstreamopen; 3 Test if xjson exists If not output xjson does not exist and quit;
- 使用ofstream的构造函数打开写入文件D:\out.txt;
- 使用ifstream::open()打开读取文件x.json;
- 测试x.json是否存在。如果不存在,则输出“x.json不存在”并退出。
原文地址: https://www.cveoy.top/t/topic/coXb 著作权归作者所有。请勿转载和采集!