I've started using the standard template library recently, but I'm really having difficulty debugging my code. The "watch window" offers very little info on the contents of say vector.
Am I missing something simple? How do I see what it is holding?
I've started using the standard template library recently, but I'm really having difficulty debugging my code. The "watch window" offers very little info on the contents of say vector.
Am I missing something simple? How do I see what it is holding?
What IDE are you using? What version?
Watching a vector or any other complex object is of course more difficult than looking at built-in types, but there are usually tricks you can use to get the information you need.
Microsoft Visual C++ .NET version 7
when you look at the vector in the watch window, you can get the ide to treat it as an array.
copy the vector from the 'locals' or 'this' window to the watch window. look for the _Myfirst var and add a ', 10' after it. this will tell the ide to treat it as an array of size 10 (insert your own size obviously)
"I saw a sign that said 'Drink Canada Dry', so I started"
-- Brendan Behan
Free Compiler: Visual C++ 2005 Express
If you program in C++, you need Boost. You should also know how to use the Standard Library (STL). Want to make games? After reading this, I don't like WxWidgets anymore. Want to add some scripting to your App?