Hi ,
I have a stl list which stores my base class pointer .Like
list<BaseClass*> eBList;
now i want to iterate through this list and store it in one local variable. how do i do this. i have shown below the code i tried .... But at one part it crashes..
list<BaseClass*>::const_iterator iter = eBList.begin( );
BaseClass *ebase
for( ; iter != eBList.end( ); iter++ )
{
if( typeid( **iter ) == typeid( DerivedClass ) )
{
*ebase = **iter; ///// CRASHES HERE .. how do i assign to this variable
break;
}
}