The file will be read line by line. So the first line would be stored in the first variable. Ofcourse, if you want to make it possible to loop throught the file until all the variables are read in then your best bet would be to use and array (not stricktly true, vectors would be better but don't worry about those yet).
so create an array of doubles then loop throught the file storing each line into the next cell in the array.
i would do something like this
#include <iostream>
#include <string>
#include <cstdlib>
#include <ifstream>
int main(void){
char myFileName[64];
string line;
double numbers[100] = {0};
int x = 0;
ifstream locationtemp;
cout << "Enter the file name.\n";
cin >> myFileName;
locationtemp.open(myFileName);
if ( !locationtemp.good() ){
cerr << "\n\nERROR:Unable to open file/File did not open correctly\n";
cin.get();
return(1);
}
while( !locationtemp.eof() ){
getline(locationtemp, line);
numbers[x++] = strtod(line);
}
locationtemp.close();
return 0;
}
Something along those lines. Untested i don't have access to compilers in college
Chris