title: How do I declare an array of undefined or no initial size?
body: <p>I know it could be done using <code>malloc</code>, but I do not know how to use it yet.</p>
  <p>For example, I wanted the user to input several numbers using an infinite loop with a sentinel to put a stop into it (i.e. -1), but since I do not know yet how many he/she will input, I have to declare an array with no initial size, but I'm also aware that it won't work like this int arr[]; at compile time since it has to have a definite number of elements.</p>
  <p>Declaring it with an exaggerated size like <em>int arr[1000];</em> would work but it feels dumb (and waste memory since it would allocate that 1000 integer bytes into the memory) and I would like to know a more <em>elegant</em> way to do this.</p>