View array in Visual Studio debugger?

user20493 picture user20493 · Jun 9, 2009 · Viewed 174.8k times · Source

Is it possible to view an array in the Visual Studio debugger? QuickWatch only shows the first element of the array.

Answer

JaredPar picture JaredPar · Jun 9, 2009

You can try this nice little trick for C++. Take the expression which gives you the array and then append a comma and the number of elements you want to see. Expanding that value will show you elements 0-(N-1) where N is the number you add after the comma.

For example if pArray is the array, type pArray,10 in the watch window.