123456
std::ifstream infile( datafile ) ; double a, b, c ; while( infile >> a >> b >> c ) { // whatever }