Viewing pointers as arrays in the Watch window of VSCode

Putting a pointer in the WATCH ov VSCode window only shows you the fist value. If only there was a way to see more elements. If only there was a way to see it a an array.

Well… In order to view pointers as arrays in WATCH of VSCode, you can do the following. In watch write:

*(uint8_t(*)[10])myPointer

In this case, we will see 10 values of uint8_t, but you can change the array size and variable type to your liking.

Happy programming!

Tom

2 Likes

Or if you only have an address:

*(uint8_t(*)[4])(uint32 *)myAddress

1 Like