I’m interested in tips and tricks regarding debugging a C/C++ project in Visual Studio’s debugger. I recently found out that if you have a pointer to a certain data type, let’s say char* ptr, then you can see it as an array in the watch window using a syntax such as:
ptr,10
This will display the first 10 elements from the ptr address, in the same way as it would be displayed if the definition would be:
char ptr[10];
What other tips and tricks do you know about Visual Studio debugger?
PS: I hope this subject wasn’t already discussed. Should you find a similar post, please let me know.
I really like the possibility to tweak the Debugger display of types and structures through AutoExp.dat. The file is located at
and allows to define own templates for the display of data during debugging:
The file is full of good examples and you can easily adapt certain templates to your own needs or add new ones for your own classes.