search

Home  >  Q&A  >  body text

C++用ofstream打开文件错误?

我的代码是这样写的
ofstream ofile;
ofile.open("e:\CodeFile2.txt");
我的e盘里面给是有这个文件的.
但是每当运行到这里的时候就会包这样的错误

然后中段之后是这样子的:

PHPzPHPz2772 days ago469

reply all(2)I'll reply

  • PHPz

    PHPz2017-04-17 15:03:49

    Should write one more

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 15:03:49

    In C/C++, it is an escape character, and the path must be double-written to represent the slash in the path.

    reply
    0
  • Cancelreply