title: How do you get the size of array that is passed into the function?
body: <p>I am trying to write a function that prints out the elements in an array. However when I work with the arrays that are passed, I don't know how to iterate over the array.</p>
  
  <pre><code>void
  print_array(int* b)
  {
    int sizeof_b = sizeof(b) / sizeof(b[0]);
    int i;
    for (i = 0; i &lt; sizeof_b; i++)
      {
        printf("%d", b[i]);
      }
  }
  </code></pre>
  
  <p>What is the best way to do iterate over the passed array?</p>