I am an artist and a total beginner in C++.I would like to find a better method of importing my variables from a values.txt file, which may contain 18 values in one column:63.644741225.2147283410.4051101930.261556475-2.00743E-092.76001E-1034.4590248215.622498520.2208616852.88127E-090.4458049792.76001E-1082.1102030614.027094060.5074879442.88127E-09-2.00743E-090.159178722 or it could contain three rows of six tab-separated columns:63.64474122 5.214728341 0.405110193 0.261556475 -2.00743E-09    2.76001E-1034.45902482 15.62249852 0.220861685 2.88127E-09 0.445804979 2.76001E-1082.11020306 14.02709406 0.507487944 2.88127E-09 -2.00743E-09    0.159178722I know my code is ugly.  Could somebody help?#include <iostream>#include <fstream>#include <algorithm>using namespace std;#define PI 3.14159265//___________________________________________________/// variables from the *.txt file double x_A = 0;double y_A = 0;double d_A = 0;double m_A = 0;double c_A = 0;double t_A = 0;double x_B = 0;double y_B = 0;double d_B = 0;double m_B = 0;double c_B = 0;double t_B = 0;double x_C = 0;double y_C = 0;double d_C = 0;double m_C = 0;double c_C = 0;double t_C = 0;//__________________________________________________int trash    = 0;   //___________________________________int main() {    ifstream ifs (values.txt); ///LOADING    if (!ifs)    // process error    ifs >> trash;    ifs >> x_A;    ifs >> y_A;    ifs >> d_A;    ifs >> m_A;    ifs >> c_A;    ifs >> t_A;    ifs >> x_B;    ifs >> y_B;    ifs >> d_B;    ifs >> m_B;    ifs >> c_B;    ifs >> t_B;    ifs >> x_C;    ifs >> y_C;    ifs >> d_C;    ifs >> m_C;    ifs >> c_C;    ifs >> t_C;cout << x_A << endl;cout << y_A << endl;cout << d_A << endl;cout << m_A << endl;cout << c_A << endl;cout << t_A << endl;cout << x_B << endl;cout << y_B << endl;cout << d_B << endl;cout << m_B << endl;cout << c_B << endl;cout << t_B << endl;cout << x_C << endl;cout << y_C << endl;cout << d_C << endl;cout << m_C << endl;cout << c_C << endl;cout << t_C << endl;}
Better importation of variables from .txt file
c++;beginner;io