Debugging arrays in the Watch Window
-
Wednesday, August 09, 2006 8:07 PMI'm using Microsoft Visual C++ version 7, and I have an array in my code. I would like to be able to see the elements of the array in the Watch window as I am debugging. Right now, if I want to see the elements of the array, I have to enter in the individual elements on separate lines like:
myarray[0]
myarray[1]
myarray[2]
If I only put in the name of the array like:
myarray
then there is a plus sign next to it, and when I expand it, I can see the first element of the array only. Is there a way to view the elements of the array without entering each one in on separate lines?
Below is some of my actual code:
//create new "shiftedarray"
int * shiftedarray = new int [ n ];
//store currentarray in shifted array
for(int i = 0; i < n; i++){
shiftedarray[ i ] = currentarray[ i ];
}
In the Watch Window I have entered "shifted array" and it looks like this:
Name Value Type
- shiftedarray 0x00333ca8 int *
1 int
But it won't show me any more than the first element of "shiftedarray" even when I expand it.
All Replies
-
Thursday, August 10, 2006 7:58 PMModerator
Sure, you should be able to use something like pArray,10 to show the array values.
Here's the info in MSDN:
http://msdn2.microsoft.com/en-us/library/75w45ekt.aspx
-
Friday, February 13, 2009 9:58 PMhow to display all of the data from a dynamic array??

