| | |
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 |
api array based beginner binary bitmap c++ c/c++ calculator char class classes code coding compile compiler console conversion count database delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream int integer java lib linkedlist linker linux list loop looping loops map math matrix memory multiple news node number output parameter pointer problem program programming project proxy python read recursion recursive reference return rpg string strings struct temperature template templates test text text-file tree unix url variable vector visualstudio win32 windows winsock word wordfrequency wxwidgets






