如何在Visual Studio 2010中查看二维数组的所有元素? [英] How to see all elements of a two dimensional array in Visual Studio 2010?

查看:954
本文介绍了如何在Visual Studio 2010中查看二维数组的所有元素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Visual Studio 2010中调试我的c ++代码,并希望看到我的数组的内容,Q是17x17。当我插入一个断点并尝试调试时,我只看到变量Q。当我把它带到监视屏幕并将其重命名为Q,17时,我看到一个级别。



但是我想看到另一个维度,太。我不能写Q,17,17。什么是正确的命令?



谢谢...

解决方案

你不能,至少不是直接。



你可以做的是把& array [0] [0] ,然后调整它的大小,所以列数匹配一行数组数据。



或者,您可以在观察窗口中放置 array [0],17 ,然后重复 array [1],17 等。



不是你正在寻找的答案,但手表窗口虽然很强大,只是不能做你想要的。


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...

解决方案

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.

这篇关于如何在Visual Studio 2010中查看二维数组的所有元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆