![]() |
#2
rjsp2016-05-20 19:22
|

#include<iostream>
#include<fstream>
#include<iomanip.h>
using namespace std;
void main()
{
ofstream f1("c:\\成绩单.txt"); //文件已创建
if(!f1)return;
f1<<setw(20)<<"姓名:"<<"小明"<<endl;
f1<<setw(20)<<"家庭地址:"<<"asd"<<endl;
f1.close();
}
#include<fstream>
#include<iomanip.h>
using namespace std;
void main()
{
ofstream f1("c:\\成绩单.txt"); //文件已创建
if(!f1)return;
f1<<setw(20)<<"姓名:"<<"小明"<<endl;
f1<<setw(20)<<"家庭地址:"<<"asd"<<endl;
f1.close();
}
错误信息:
error C2679: binary '<<' : no operator defined which takes a right-hand operand of type 'class __SMANIP_int' (or there is no acceptable conversion)
请问这个错误信息是什么 错哪里了?