title: Is it possible to get the length of an array using a function?
body: <p>As far as I know, the following code can be used to obtain the length (meaning how many items it contains) of an array (in this example, an integer array):</p>
  
  <pre><code>int arrayOfInt[] = { 10, 20, 30, 40, 50 };
  
  int lenght = sizeof(arrayOfInt) / sizeof(int);
  </code></pre>
  
  <p>This gives "5" as output, which is correct.
  However, if i use the same code in a function, it does not work.</p>
  
  <pre><code>int getLenght(int intArray[])
  {
      return sizeof(intArray) / sizeof(int);
  }
  
  lenght = getLenght(arrayOfInt);
  </code></pre>
  
  <p>Using the function above, i get "1" as output. Which is not correct. Why does this happen? Am i doing something wrong or is it not possible?</p>