Dynamic Memory Allocation

Essentially, I have an assignment where we were given a data file of ~140 values, and I must sort them into an array and then do some math with them. The guidelines state, " read the file and count how many values there are
based on your count, create an array of the appropriate size using dynamic memory allocation"

I understand how to count them and start the initial dynamic array: double value=new double[x];

But, after I set my array size, how do I incorperate my data file values into the array?

Subscript operator []: p[position] = val;.
value[position] = value_from_file
Topic archived. No new replies allowed.