在 QtCreator 中查看数组内容 [英] View Array contents in QtCreator
问题描述
在Qt Creator中调试时是否可以查看数组的内容?
Is it possible to view the contents of an array in Qt Creator when debugging?
似乎检测到我的数组是数组而不是指针.此外,我可以点击一个箭头,就像展开一样 - 但之后没有任何显示.
It seems to detect that my array is an array and not a pointer. Additionally, an arrow becomes available for me to click on as if to expand - but nothing shows after that.
当我在 std::vector
上尝试时,Qt Creator 设法按预期显示内容.
When I tried it on std::vector
, Qt Creator managed to display the contents as expected.
PS:我发现了这篇关于查看数组内容的旧帖子,但它已超过 2 年,似乎不再相关.
PS: I found this old post about viewing array contents, but its over 2 years old and does not seem relevant anymore.
推荐答案
如果你的意思是像
int array[20]
您可以以这种形式手动添加手表":
you can add a 'watch' manualy in this form:
(int[20])array
您可以在变量视图中添加它.
You can add it in your variables view.
这篇关于在 QtCreator 中查看数组内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!