title: Why the pointer hack for finding the size of an array in C giving different value when used in a called function
body: <p>This is the code below to illustrate the issue:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  void func(int arr[]);
  
  int main() {
      int arr[10];
      int n = *(&amp;arr + 1) - arr;
      printf("%d\n", n);
      func(arr);
      return 0;
  }
  
  void func(int arr[]) {
      int n = *(&amp;arr + 1) - arr;
      printf("%d\n", n);
  }
  </code></pre>
  
  <p>Output of the above code is:</p>
  
  <pre><code>10
  268435906
  </code></pre>