.txt file into an array

I need to know how to store numbers from a file into an array, but we don't know how many numbers will be given. what can i do to adjust the array depending on how many numbers are given?
Do you want to be able to store values that you read from a file? Use std::vector.
See http://www.cplusplus.com/reference/vector/vector/

Or, do you actually want to learn logical thinking by playing only with low level language constructs? Then the keyword is dynamic memory allocation / reallocation / deallocation. (The vector does that automatically.)
Can you give more information about the problem. Do you have to use an array? What exactly are you trying to have your program do?
Topic archived. No new replies allowed.