title: lldb : Printing a variable's address
body: <p>I am trying to print a variable's address with <code>lldb</code>. However, calling <code>print &amp;(myVar)</code> prints the variable's content instead of its address.</p>
  
  <pre><code>(lldb) print &amp;(myVar)
  (const string *) $18 = "hello"
  </code></pre>
  
  <p>Same for <code>expression &amp;(myVar)</code>.</p>
  
  <pre><code>(lldb) expression &amp;(myVar)
  (const string *) $19 = "hello"
  </code></pre>
  
  <p>I also tried <code>expression</code>'s <code>-L</code> option :</p>
  
  <pre><code>(lldb) expression -L -- &amp;(myVar)
  0x00000000021aea80: (const string *) $20 = "hello"
  
  (lldb) expression -L -- myVar
  0x0000000002a15430: (std::string) $23 = "hello"
  </code></pre>
  
  <p>However the address outputted changes each time I invoke <code>expression -L</code>. Hence I am assuming that it does not correspond to the variable's address in memory.</p>
  
  <p>How do I get the variable's address in memory ?</p>
  
  <p>(I use lldb 3.4)</p>