Skip to main content
gamedev.net
🔒 Locked

Debugging std::vectors

Started by Skibum 3 replies 200+ views
Original Post
Skibum
Skibum
I''m using MSVC 6.0 and std::vector on a custom struct. I am able to see the first struct in the watch window using this: (*m_Vector._First) Is there a way to see the second, third, etc in the debug window without changing my code?
Seifer
Seifer
(*m_Vector._First+1) should do it.
I hate signatures.
Skibum
Skibum
Nope. I can do (*m_Vector._First++) but in Visual Studio this actually changes the value of the "_First" var and this is not desirable.
Seifer
Seifer
Oh yeah I hadn''t noticed the *. You''re dereferencing it that''s why it changes the value. (m_Vector._First+1) should do it. It works with my compiler.
I hate signatures.
Skibum
Skibum
Oh so sweet, thanks so much!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.