title: Printing out an array in C without a predetermined length
body: <p>I'd like to print out an entire array in C. I've tried using <code>sizeof</code> to determine the length of the array in order to print it with a for loop, but it didn't work and returned an error. What did I do incorrectly, and else can I try?</p>
  
  <pre><code>// The items in the array are determined by user input
  int length = (sizeof(my_array) / sizeof( my_array[0])) + 1;
      printf("%d\n", length);
      for(int i = 0; i &lt; (sizeof(my_array) / sizeof( my_array[0])) + 1; i++)
      {
              printf("%s\n", my_array[i]);
      }
  </code></pre>