Eclipse-C ++ - 调试:查看数组的内容 [英] Eclipse-C++-Debugging: see content of an Array

查看:130
本文介绍了Eclipse-C ++ - 调试:查看数组的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以看到动态分配的数组的内容,如:

Is it possible to see the content of a dynamically allocated array, as in:

int *array = new int[dimension];

我只看到指针的值。

编辑:刚刚找到选项显示为数组,但是我总是必须手动输入数组的大小。在eclipse中,可以自动获取这些内容吗?

edit: just found the option "display as an array", but I always have to manually enter the size of the array. Is it possible to get that automagically?

推荐答案

可以看到动态分配的数组的内容绊倒这个问题),

in eclipse, to see the content of a dynamically allocated array (for anyone else that stumbles across this question),


  1. 确保你处于调试的角度。寻找变量窗口。如果没有看到,请点击窗口>显示视图>变量。

  2. 右键单击数组变量

  3. 点击显示为数组

  4. eclipse不知道你的数组有多大,所以键入0为开始索引和动态分配的长度的元素数量。

  1. make sure you are in the debugging perspective. look for the "variables" window. if you don't see it, click "window" > "show view" > "variables".
  2. right click on the array variable
  3. click display as array
  4. eclipse doesn't know how big your array is, so type 0 for the start index and the number of elements you dynamically allocated for the length.

这篇关于Eclipse-C ++ - 调试:查看数组的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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