STL debugging in VC++6
-
Hi Could someone tell me how I can debug STL types easily in VC++ 6? Everytime I use e.g. vector I can never see its content in the debug window. Thanks!
Add this: std::basic_string<*>= std::vector<*>=size=, capacity= std::map<*>=size=<_Mysize, i> std::set<*>=size=<_Mysize, i> std::list<*>=size= std::deque<*>=size= std::pair<*>=first=, second= std::list<*>::iterator=val=<_Ptr->_Myval> std::list<*>::const_iterator=val=<_Ptr->_Myval> std::_Tree<*>::iterator=val=<_Ptr->_Myval> std::_Tree<*>::const_iterator=val=<_Ptr->_Myval> To VSDir\Common\MSDev98\Bin\Autoexp.dat That will give you some more info on the stl types. To actually see the contents of a vector, say called m_vec, you can actually take the address of the first element to be equal to the address of an standard C array stored in the vector - say &m_vec[0]; This is because STL gaurentees that the vector occupies contigous memory. If m_vec was a vector of ints (and your using STL port), you can do this: ((int*)&m_vec[0]), 100 to expand 100 elements in the vector in the watch window. Unfortunatly, standard stl wont let u call [] operator in the watch window. You can do ((int*)&(*m_vec.begin())), 100 If you can remeber all that lol