c ,c++ 关于输入输出流的问题
#include<fstream>#include<iostream>#include<string.h>usingnamespacestd;intmain(){ofst...
#include <fstream>
#include <iostream>
#include <string.h>
using namespace std;
int main()
{
ofstream outfile;
outfile.open("c:\users\wawa\desktop\wawa.txt",ios::app);(报错)
cout<<outfile<<endl;
outfile << "哇哇" << endl;
outfile << "Hello world!" << endl;
outfile.close();
return 0;
}
为什么出错了?
error: incomplete universal character name \u
warning: unknown escape sequence '\w'
warning: unknown escape sequence '\d'
warning: unknown escape sequence '\w'
||=== Build finished: 1 errors, 3 warnings ===| 展开
#include <iostream>
#include <string.h>
using namespace std;
int main()
{
ofstream outfile;
outfile.open("c:\users\wawa\desktop\wawa.txt",ios::app);(报错)
cout<<outfile<<endl;
outfile << "哇哇" << endl;
outfile << "Hello world!" << endl;
outfile.close();
return 0;
}
为什么出错了?
error: incomplete universal character name \u
warning: unknown escape sequence '\w'
warning: unknown escape sequence '\d'
warning: unknown escape sequence '\w'
||=== Build finished: 1 errors, 3 warnings ===| 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询