Hello I am using c++ and i read the file using fgets, i am using while loop and sscanf to push back to my vector double while i would like to do it using a single line, like in case of ifstream but i dont want to use get line. 

```
%% My stream of data
  151  150  149  148  147  146  145  144  143  143  141  139  138  137  135 
  132  130  130  129  128  127  127  128  129  130  129  128  127  126  127 
  127  127  127  128  128  128  129  130  130  131  131  132  132  133  133 

%% My code
vector<double> vec_TEC1D;
double temp_holder = 0.0;

while(!feof(fileptr))
    {
      fgets(line, LENGTH_LINE, fileptr);
      .....
      while(strstr(line, '\n') != NULL){
                  sscanf(line, "%lf", &temp_holder);
                  vec_TEC1D.push_back(temp_holder);
              }
      }     

```

I am already using 2 while loop outside the above one for other purposes, hence i would like to avoid this..

Thank you for your help!! :)
Priya