const variable in c++
<p>these are the some silly question ..i want to ask..please help me to comprehend it  </p>

<pre><code>const int i=100;   //1
///some code
long add=(long)&amp;i;  //2
</code></pre>

<p>Doubt:for the above code..will compiler first go through the whole code<br>
for deciding whether memory should be allocated or not..or first it ll store the<br>
variable in read only memory place and then..allocate stroage as well at 2</p>

<p>doubt:why taking address of variable enforce compiler to store variable on memory..even<br>
though rom or register too have address</p>
