Posts

Showing posts from July, 2005

Using the Visual Studio .NET QuickWatch window

According to the MSDN documentation you can write C++ expressions in the QuickWatch window and have them evaluated. There are some documented limitations but in practice getting something to work in the QuickWatch window is very hit and miss. If you want to debug STL you run up against the limitations pretty quickly. Say we have the following code: vector<int> a; a.push_back(1); a.push_back(2); a.push_back(3); If we run this code and break into the debugger you'd hope that you could inspect the values in the vector by typeing things like a[0] into the QuickWatch window, but alas this results in: a[0] CXX0058: Error: overloaded operator not found Okay so lets try a.at(0): a.at(0) CXX0039: Error: symbol is ambiguous Hmmm, a.capacity() and a.size() work okay but how do we inspect the values? It seems the only reliable way is to rely on some knowledge of the underlying implementation: (a)._Myfirst[0] or if you want to see all the values: (a)._Myfirst,3 the ',3'