| | |
Accessing a list of Pointer
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Sep 2008
Posts: 11
Reputation:
Solved Threads: 0
Hi ,
I have a stl list which stores my base class pointer .Like
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..
I have a stl list which stores my base class pointer .Like
C++ Syntax (Toggle Plain Text)
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..
C++ Syntax (Toggle Plain Text)
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; } }
![]() |
Similar Threads
- Cannot find server or DNS Error - please help! (Viruses, Spyware and other Nasties)
- Double linked list - possible memory error (C)
- Doubly Linked List Problem (C++)
- chars and pointers and all that fun stuff (C++)
- How to delete a data structure in Builder 6.0? (C++)
- How to be Crash Free (C++)
Other Threads in the C++ Forum
- Previous Thread: Infininate loop
- Next Thread: abit of help needed help..ty
| Thread Tools | Search this Thread |
Tag cloud for C++
api application array arrays based beginner binary bmp c++ c/c++ calculator char char* class classes code compile compiler console conversion convert count data delete deploy dll download dynamiccharacterarray email encryption error file format forms fstream function functions game givemetehcodez graph homeworkhelp iamthwee ifstream input int java lib library lines list loop looping loops map math matrix memory newbie news number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg search simple sorting spoonfeeding string strings struct temperature template templates text text-file tree url variable vector video visual visualstudio void win32 windows winsock wordfrequency wxwidgets






