If you have a vector containing pointers, how do you get another pointer to point where one of the pointers in a vector is pointing.
If what I said is hard to understand then here's the basic idea of what i want to accomplish
(not actual code from a program)
Code:#include <vector> #include <anyThingElseRequired> using std::whateverComesFromTheStdNamespace; ... vector<someObject*> v; //vector full of pointers to someObject? someObject *phead; //pointer to someObject v.put_back(phead); //no trouble here someObject *pnext; //pointer to someObject pnext = v[0]; //cannot convert `std::vector<someObject*, //std::allocator<someObject*> >' to `someObject*' in //assignment
How do i get pnext to point to the same object that the pointer stored at v[0] is pointing to?
-Thank you for your patience



LinkBack URL
About LinkBacks



