title: C- Incompatible pointer types initializing 'int *' with an expression of type 'int
body: <p>I've a problem and I don't understand why compiler says me this warning:</p>
  
  <blockquote>
    <p>Incompatible pointer types initializing 'int *' with an expression of type 'int [2][2]'</p>
  </blockquote>
  
  <pre><code>int matrice[2][2]={4,7,3,6};
  int* prova2=matrice;
  for (int i=0; i&lt;4; i++) {
  printf("%d",*(prova2+i));
  }
  </code></pre>
  
  <p>Logically, it works but I want to know why the IDE show me that.
  I've tried to do the same with an array but it works without any warning.</p>
  
  <p>I know that when I declare an array like</p>
  
  <pre><code>int a[4]; 
  </code></pre>
  
  <p>a contains the address where the array is allocated in memory.
  So, there aren't differences (type differences) between </p>
  
  <pre><code>int a[4]; 
  </code></pre>
  
  <p>or </p>
  
  <pre><code>int *b= a;
  </code></pre>
  
  <p>Why are there differences between </p>
  
  <pre><code>int matrice[2][2]
  </code></pre>
  
  <p>and </p>
  
  <pre><code>int* prova2=matrice;
  </code></pre>
  
  <p>?</p>