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.
EDIT: I am referring specifically to arrays on the heap. Arrays on the stack can be visualised.
The answer by cubuspl42 works for GDB. But if you're on a Mac using LLDB as your debugger, the correct method is
(MyType(*)[128])myArray
Hope this helps!
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.
If you array is stored in void *
variable, you need to do something more tricky:
(MyType[128])*(char*)myArray
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With