title: pointer typecasting
body: <pre><code>int main()
  {
  int *p,*q;
  p=(int *)1000;
  q=(int *)2000;
  printf("%d:%d:%d",q,p,(q-p));
  }
  </code></pre>
  
  <p>output</p>
  
  <pre><code>2000:1000:250
  </code></pre>
  
  <p>1.I cannot understand <code>p=(int *)1000;</code> line, does this mean that p is pointing to 1000 address location? what if I do <code>*p=22</code> does this value is stored at 1000 address and overwrite the existing value? If it overwrites the value, what if another program is working with 1000 address space?</p>
  
  <ol>
  <li>how <code>q-p=250</code>?</li>
  </ol>
  
  <p><strong>EDIT:</strong>  I tried <code>printf("%u:%u:%u",q,p,(q-p));</code> the output is the same</p>
  
  <pre><code>int main()
  {
  int *p;
  int i=5;
  p=&amp;i;
  printf("%u:%d",p,i);
  return 0;
  }
  </code></pre>
  
  <p>the output</p>
  
  <pre><code>3214158860:5
  </code></pre>
  
  <ol>
  <li>does this mean the addresses used by compiler are integers? there is no difference between normal integers and address integers? </li>
  </ol>