you can try assigning them to array
#include <iostream>
#include <fstream>
using namespace std;
int main() {
double arr1[size];
ifstream input("file.txt");
for (int i = 0; i < size; i++) {
input >> arr1[i];
cout<< arr1[i]<<std::endl;
}
}
1
solved avoiding the spaces and lines while reading text file in c++ [closed]