title: Getting garbage value while passing an entire array to a function
body: <p>I'm trying to pass an entire array to the function but the last value i get is always a garbage value and not 3. Please point out where I've made a mistake.</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;conio.h&gt;
  
  main() {
      int array[3] = {0, 1, 2, 3};
      display(&amp;array[0], 3);
  }
  display(int *j, int n) {
      int i;
  
      for(i=0; i&lt;=n; i++) {
          printf("\n%d", *j);
          j++;
      }
  }
  </code></pre>