首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

VS2008 Vector使用有关问题

2013-11-11 
VS2008 Vector使用问题求助!有如下定义:其中bone是一个类vecoorbone bonevecvectorbone::iterator th

VS2008 Vector使用问题求助!
有如下定义:
其中bone是一个类
vecoor<bone> bonevec;
vector<bone>::iterator theIterator;
bone *pbone = 0;
接下来两处代码出错:
(1)theIterator=0;
error C2679: binary '=' : no operator found which takes a right-hand operand of type 'int' (or there is no acceptable conversion)

(2)for (theIterator = bonevec.begin(); theIterator != bonevec.end();
         theIterator++)
    {
  pbone = theIterator;
    }
error C2440: '=' : cannot convert from 'std::_Vector_iterator<_Ty,_Alloc>' to 'bone *'
1>        with
1>        [
1>            _Ty=bone,
1>            _Alloc=std::allocator<bone>
1>        ]
1>        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
在VC6下编译没有问题啊,该怎么解决?求大家指点迷津啊!

[解决办法]
我不得不承认,VC6就是个神器!

热点排行