I am trying to read in a txt file that contains some doubles as shown below. I have read into it quite a bit and cannot figure out how to get it to read in the file. It is requested that I make an array large enough to hold up to 100 variables. I would just like some input on how to make this work, thanks for your help.
Hmm. Try outputting the doubles to console, with cout<< or something. You are just writing to the program, not the console. Nest this loop in your for loop:
You created your array within the scope of an if statement if (file.is_open()) // note: just 'if ( file )' works too
the array is deleted when it goes out of scope at line 17.