I'm using Visual Studio 2017 and I need to look at the binary representation of integer variables.
How can this be achieved from the Visual Studio debugger?
Type 'var, b' in the watch, for example,
According to the Visual Studio debugger documentation:
You can change the format in which a value is displayed in the Watch, Autos, and Locals windows by using format specifiers.
This note on debugging engine updates and compatibility is also worth noting:
When the Visual Studio native debugger changed to a new debugging engine, some new format specifiers were added and some old ones were removed. The older debugger is still used when you do interop (mixed native and managed) debugging with C++/CLI.
Although it mentions it can be applied to Autos
and Locals
windows, it is unclear how it is done as the variable names cannot be edited in those windows.
A <variable>, <format>
syntax may be used in Watch
and Immediate
windows, like so:
Here is a direct link to the complete list of format specifiers.
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