I'm debugging my c++ code in Visual Studio 2010 and want to see the content of my array, say Q, which is 17x17. When I insert a breakpoint and try to debug, I see only the variable "Q". When I take it to the "Watch" screen and rename it to "Q,17", I see one level down.
But I want to see the other dimension,too. I can't write "Q,17,17". What is the proper command?
Thank you...
An element in 2-dimensional array is accessed by using the subscripts. That is, row index and column index of the array. int x = a[1,1]; Console.
If you want to see the values organized in 2D in a more graphical way, you can try the Array Visualizer extension. It works fine with small multidimensional arrays. It is a free, open source extension which can be downloaded via MarketPlace. It is designed to display arrays while debugging an application.
Accessing 2D Array Elements In Java, when accessing the element from a 2D array using arr[first][second] , the first index can be thought of as the desired row, and the second index is used for the desired column. Just like 1D arrays, 2D arrays are indexed starting at 0 .
The total number of elements that can be stored in a multidimensional array can be calculated by multiplying the size of all the dimensions. For example: The array int x[10][20] can store total (10*20) = 200 elements. Similarly array int x[5][10][20] can store total (5*10*20) = 1000 elements.
You can't, at least not directly.
What you can do is put &array[0][0]
in the memory window, and then resize it so the number of columns matches one row of array
data.
Alternatively, you can put array[0],17
in the watch window, and then repeat it for array[1],17
, etc.
Not the answer you were looking for perhaps, but the watch window, while pretty powerful, just can't do what you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With