当我尝试使用文件路径打开文件时出现错误
out_stream5.open("C:pathshowitems.txt", ios::out);
警告 C4129:“o”:无法识别的字符转义序列 error C2100: 非法间接寻址
最佳答案
我假设您正在使用 Windows。问题可能是您需要转义反斜杠:
out_stream5.open("C:\\path\\showitems.txt", ios::out);
关于c++ - 当我尝试使用特定路径打开文件时出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2679056/