I am working on a program that will read in a file. The first integer in the file will tell the user how many numbers will be read in next.
The input file might look as follows:
1 2 3 4 5
4
65
56
89
12
so the first integer is saying there is 4 numbers in this file.
now i need to store the following 4 numbers into an array. My problem is that the size of these numbers in this file might change. For instants it might contain 20 or even 100 numbers.
How can i declare an array that will use this first integer as its size?
You have declared Numbers twice; once on line 7, and again on line 15. The compiler can't assign the same identifier (name) to two different things like that.
Put the the delete[] statement after you are done with the array, as it will destroy it.