title: How to view binary content of a C++ integer in gdb?
body: <pre><code>int main()
  {
       int a = 0;
  }
  </code></pre>
  
  <p>I compile: <code>g++ -std=c++14 -g test.cpp</code></p>
  
  <p>Run program in gdb:</p>
  
  <p><code>gdb ./a.out</code></p>
  
  <p><code>(gdb) break main</code></p>
  
  <p><code>(gdb) run</code></p>
  
  <p><code>(gdb) next</code></p>
  
  <p>What I have tried:</p>
  
  <p><code>(gdb) print /t &amp;a</code></p>
  
  <p>That prints <code>11111111111111111111111111111111101110101111100</code></p>
  
  <p>That doesn't look like the right number, I was expecting 0000....0000. How can I print binary values from the memory location of the integer variable a ?</p>