1

I am writing a C program in VS 2013 and I want to debug a particular sub-array from full 2D matrix of ints. For example, using debugger watch window, I can print like,

Mat        // this shows the full NxM Mat matrix values
Mat[i][j]  // this shows value of cell (i, j)
Mat[i]     // this shows the values of full i'th row
Mat[i], j  // this shows first j values from i'th row

But I want to print a snapshot of a sub-part of Mat, which consists of (i1, j1) to (i2, j2) in small 2D grid. Is it possible? I require it because sometimes debugging smaller sub-array seems a tedious work especially when the main array is too big and I am interested to a subpart somewhere in the bottom-right corner of the full array.

Any workaround, if there is no standard way?

gsamaras
  • 71,951
  • 46
  • 188
  • 305
Sazzad Hissain Khan
  • 37,929
  • 33
  • 189
  • 256

1 Answers1

1

You can't do what you want with one command, but maybe you could work this out based on this, where he mentions that:

Mat + 100, 10

which will show the 10 elements starting at Mat[100]. You don't want that, but if you could play around and get the elements at j1, then you could combine them to get a subarray, maybe.

PS: Give the memory window a try too, as described here.

gsamaras
  • 71,951
  • 46
  • 188
  • 305