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?

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks. Where can I get the Memory Window?
You are welcome @SazzadHissainKhan, I don't have VS studio now, so I just googled and got this. Hope that helps, cheers!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.