Lab137
articles

Viewing Array Contents During Debugging in VS Code

Published Wed 20 May 2020 in articles

by Jay Ess til vscode debug c++

After getting annoyed with adding a bunch of array indices to the watch list for a program that I was debugging, I went in search of a better solution. I came across an issue on the VS Code C/C++ Tools GitHub repo. Apparently, you can use the following pattern in the watch list instead

*(int(*)[10])some_pointer

to see the contents of the array some_pointer of type int. Or, basically

*(<type>(*)[arrSize])arrName

Even better, you can use the following

*arrName@arrSize

Here's a screenshot of doing it manually

Manually adding array elements during
debug

and here's a screenshot of using the shortcut

Shortcut of viewing array elements during
debug

Much better.

Other articles

C++: Simple Structs Usage

Wed 19 June 2019

Similar to arrays, structs allow you to hold a group of data. structs allow you to group together related...

Previous Next page
  • Page 1 / 1

Other Pages

  • About
  • Privacy Policy

Social

  • LinkedIn
  • GitHub
  • Atom Feed

License

  • CC BY-SA 4.0
Bulrush theme for Pelican HTML 5 CSS 3 Made with Bulma