error C2039: 'push_back' : is not a member of 'basic_string请问是怎么回事?
#include<iostream>#include<fstream>
#include<algorithm>
#include<string>
using namespace std;
//----------------------
int main()
{
ifstream in("remainder.txt");
for(string s,t,u;in>>s>>t;u="")
{
sort(s.begin(),s.end());
sort(t.begin(),t.end());
cout<<s<<endl;
cout<<t<<endl;
set_difference(s.begin(),s.end(),t.begin(),t.end(),back_inserter(u));
cout<<u<<endl;
}
}
e:\vc6.0\microsoft visual studio\vc98\include\iterator(82) : error C2039: 'push_back' : is not a member of 'basic_string<char,struct std::char_traits<char>,class std::allocator<char> >'
e:\vc6.0\microsoft visual studio\vc98\include\iterator(82) : while compiling class-template member function 'class std::back_insert_iterator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > &__thiscal
l std::back_insert_iterator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >::operator =(const char &)'
执行 cl.exe 时出错.
剩余串排列1.obj - 1 error(s), 0 warning(s)