#include<iostream> #include<fstream> #include<string> using namespace std; void main() { ofstream f
#include<iostream>#include<fstream>#include<string>usingnamespacestd;voidmain(){ofstr...
#include<iostream>
#include<fstream>
#include<string>
using namespace std;
void main()
{
ofstream fout;
fout.open("1.txt");
ifstream fin("1.txt");
string a,b="12";
cin>>a;
fout<<a;
fout.close();
fin>>a;
cout<<a-b;
}
:\users\wentian\desktop\新建文件夹\0.cpp(15) : error C2784: '_D __cdecl std::operator -(const class std::reverse_iterator<_RI,_Ty,_Rt,_Pt,_D> &,const class std::reverse_iterator<_RI,_Ty,_Rt,_Pt,_D> &)' : could not deduce template argument for 'cons
t class std::reverse_iterator<_RI,_Ty,_Rt,_Pt,_D> &' from 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >'
c:\users\wentian\desktop\新建文件夹\0.cpp(15) : error C2676: binary '-' : 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' does not define this operator or a conversion to a type acceptable to the predefined
operator
执行 cl.exe 时出错.
0.obj - 1 error(s), 0 warning(s)
请教高手! 展开
#include<fstream>
#include<string>
using namespace std;
void main()
{
ofstream fout;
fout.open("1.txt");
ifstream fin("1.txt");
string a,b="12";
cin>>a;
fout<<a;
fout.close();
fin>>a;
cout<<a-b;
}
:\users\wentian\desktop\新建文件夹\0.cpp(15) : error C2784: '_D __cdecl std::operator -(const class std::reverse_iterator<_RI,_Ty,_Rt,_Pt,_D> &,const class std::reverse_iterator<_RI,_Ty,_Rt,_Pt,_D> &)' : could not deduce template argument for 'cons
t class std::reverse_iterator<_RI,_Ty,_Rt,_Pt,_D> &' from 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >'
c:\users\wentian\desktop\新建文件夹\0.cpp(15) : error C2676: binary '-' : 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' does not define this operator or a conversion to a type acceptable to the predefined
operator
执行 cl.exe 时出错.
0.obj - 1 error(s), 0 warning(s)
请教高手! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询