list<char*>和vector<string>容器使用assign在VC运行出错
#include <iostream>#include <string>
#include <vector>
#include <list>
#include<deque>
#include<algorithm>
using namespace std;
void main()
{
list<char*> cd;
char df[2][3];
for(int i=0;i<2;++i)
{
cin>>*(df+i);
cd.push_front (*(df+i));
}
vector<string> er;
er.assign(cd.begin(),cd.end());
}
E:\电子图书\VC制作\C测试\cs1.cpp(20) : error C2664: 'void __thiscall std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,
class std::allocator<char> > > >::assign(const class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > *,const class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > *)' : cannot conve
rt parameter 1 from 'class std::list<char *,class std::allocator<char *> >::iterator' to 'const class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
急求高手解释一下原因