当我尝试使用特定路径打开文件时出现错误

时间:2010-04-20 22:10:59

标签: c++ filepath

当我尝试使用文件路径打开文件时出现错误

out_stream5.open("C:pathshowitems.txt", ios::out);

警告C4129:'o':无法识别的字符转义序列  错误C2100:非法间接

1 个答案:

答案 0 :(得分:2)

我认为您正在使用Windows。问题可能是您需要转义反斜杠:

out_stream5.open("C:\\path\\showitems.txt", ios::out);