I'm pretty new still to c++ so bear with me, I'm given a .cpp file (for homework), this file populates an array from a file, that contains only numbers, using the standard method of populating an array but I'm supposed to modify it so that the array gets populated using a pointer, pretty simple right? Not so for me, I think I'm still confused on the concept of pointers. Here's what I have so far...
mistake1: float *pt_double_array = double_array[0]; It should be float *pt_double_array = double_array; (And why your double array is of float type?)
mistake 2: your loop is messed up. It can read more values that your file contains and can overwrite first values if file is larger than MAX_SIZ values
mistake 3: you are overwriting pointer value, not the value it points to.
All you need is that instead of lines 20-30:
1 2
while(pt_double_array != double_array + MAX_SIZE && in >> *pt_double_array)
++pt_double_array;