In Clion#39;s debugger, how do I show the entire contents of an int array(在 Clion 的调试器中,如何显示一个 int 数组的全部内容)
问题描述
现在它只显示数组的第一个元素,但我想要查看数组中的所有元素.我认为 Clion 正在使用 GDB.
Right now it is only showing the first element of the array but I want a visual of all the elements in the array. I think Clion is using GDB.
我特指堆上的数组.堆栈上的数组可以可视化.
I am referring specifically to arrays on the heap. Arrays on the stack can be visualised.
推荐答案
很遗憾,CLion 目前不支持该功能.正如 JetBrains 员工 建议的那样,您可以使用解决方法.在 Evaluate/Watches 窗口中使用以下表达式:
Unfortunately, CLion doesn't currently support such feature. As suggested by JetBrains employee, you can use a workaround. In Evaluate / Watches window use the following expression:
(MyType[128])myArray
您可以使用任意数组大小;任何适合你的.
You can use arbitrary array size; whatever works for you.
如果你的数组存储在 void *
变量中,你需要做一些更棘手的事情:
If you array is stored in void *
variable, you need to do something more tricky:
(MyType[128])*(char*)myArray
这篇关于在 Clion 的调试器中,如何显示一个 int 数组的全部内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 Clion 的调试器中,如何显示一个 int 数组的全
基础教程推荐
- 什么是T&&(双与号)在 C++11 中是什么意思? 2022-11-04
- 如何定义双括号/双迭代器运算符,类似于向量的向量? 2022-01-01
- 运算符重载的基本规则和习语是什么? 2022-10-31
- 您如何将 CreateThread 用于属于类成员的函数? 2021-01-01
- C++,'if' 表达式中的变量声明 2021-01-01
- C++ 程序在执行 std::string 分配时总是崩溃 2022-01-01
- C++ 标准:取消引用 NULL 指针以获取引用? 2021-01-01
- 设计字符串本地化的最佳方法 2022-01-01
- 调用std::Package_TASK::Get_Future()时可能出现争用情况 2022-12-17
- 如何在 C++ 中处理或避免堆栈溢出 2022-01-01