title: how to iterate through an array without knowing the size in c
body: <p>I have a pointer to an array in C which I would like to iterate through, but I don't know the size:</p>
  <pre class="lang-c prettyprint-override"><code>int *array;
  </code></pre>
  <p>I am unsure as to how I should proceed. I was thinking that I should probably try by finding the size by doing:</p>
  <pre><code>int array_size = sizeof(array) / sizeof(int);
  </code></pre>
  <p>But I don't know if that could work. I was wondering if there was a more optimal way of doing this?</p>