My aim is to allow the user to input positive integers, which will be stored in an array with just enough memory, so each time a new number is entered, the array size is increased by 1. When -1 is entered, the loop is stopped and the entered numbers are printed out.
I am getting 3 errors, expected constant expression, cannot allocate an array of constant size 0 and numArray unknown size. Could someone please help, its a simple issue I just cant get my head around it.
In your code, I can see your increasing the size of your array as you go. You can only allocate a set amount of space for an array.
If you initialize your array like that (int numArray[ARRAY_SIZE]), it's good to initialize ARRAY_SIZE as a constint ARRAY_SIZE = 15, where const int means that it will never change.
I would use a for() loop to get the input (int i, i < ARRAY_SIZE; i++), then as you did, a for() loop to print out the input.