title: arrays as arguments to functions
body: <pre><code>#include &lt;stdio.h&gt;
   
  
  void fun(int arr[]) 
     unsigned int n = sizeof(arr)/sizeof(arr[0]);
     printf(&quot;\nArray size inside fun() is %d&quot;, n);
  }
  int main()
  {
     int arr[] = {1, 2, 3, 4, 5, 6, 7, 8};
     unsigned int n = sizeof(arr)/sizeof(arr[0]);
     printf(&quot;Array size inside main() is %d&quot;, n);
     fun(arr);
     return 0;
  }
  </code></pre>
  <p>Why are people writing that n=size of array/ size of arr[0] ? and also why the values of n different ? inside main and inside function?</p>