title: Consecutive Memory Allocation
body: <p>I used the following code to find the difference between the address of two consecutive blocks of memory in an array. Although the printed size of each item('int' here) is 4, the difference between the address of two consecutive blocks containing that item turns out to be 1. Shouldn't the difference be 4?</p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;vector&gt;
  #include&lt;algorithm&gt;
  using namespace std;
  
  int main() {
      int a[10];
  
      for(int i=0;i&lt;10;i++)
          cin&gt;&gt;a[i];
  
      cout&lt;&lt;"size of 1 block = "&lt;&lt;sizeof(int)&lt;&lt;"\n";
  
      for(int i=1;i&lt;10;i++){
      // cout&lt;&lt;"Difference between address of consecutive memory blocks\n";
         cout&lt;&lt;" "&lt;&lt;&amp;(a[i])- &amp;(a[i-1])&lt;&lt;"\n";
      }
      return 0;
  }
  </code></pre>
  
  <p><strong>Output</strong></p>
  
  <blockquote>
    <p>size of 1 block = 4<br>
     1<br>
     1<br>
     1<br>
     1<br>
     1<br>
     1<br>
     1<br>
     1<br>
     1  </p>
  </blockquote>