title: Why is sizeof(int) different than sizeof(int*)?
body: <p>I am wondering why in the following program <code>sizeof(int)</code> returns a different value than <code>sizeof(int*)</code>.</p>
  
  <p>Here is the small program:</p>
  
  <pre><code>int main(){
      std::cout&lt;&lt;sizeof(int)&lt;&lt;endl;
      std::cout&lt;&lt;sizeof(int*)&lt;&lt;endl;
      return 0;
  }
  </code></pre>
  
  <p>And here is the output:</p>
  
  <pre><code>4
  8
  </code></pre>
  
  <p>Till now I remember the size of a integer pointer is 4byte(gcc compiler). How can I check the correct size of a pointer? Is it computer dependent?</p>
  
  <p>I am running ubuntu 12.04</p>
  
  <pre><code># lsb_release -a
  
  Distributor ID: Ubuntu 
  Description: Ubuntu 12.04 LTS 
  Release:    12.04 
  Codename:   precise
  </code></pre>
  
  <p>Is the size of pointer is not constant(standard size)  8 bytes.</p>