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

查看:2861
本文介绍了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. 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天全站免登陆