I'm using the ->size() operator to compute the number of elements in an array of strings, but the result is clearly wrong (returns 1 for a 2-element array).
How can I fix my code?
Is this so because " Array name is a pointer to the first element of the array", as I found on a website (don't know if I can post the link)?
While an array decays to a pointer quite easily this is not the reason your code is producing the output you're getting. The reason is because you're using the operator-> when accessing the array.