#include <iostream> //for cin and cout
#include <iomanip> //format output data
#include <cmath> //for enables math functions to be used
#include <string> //for string variables
#include <fstream> //for files
//-------------------------Defines this to all function-------------------------
const double pi = 3.14159565;
const double radius = acos(-1.0);
const int Col = 4;
//------------------------------------------------------------------------------
int main ()
{
double value[100][Col];
string filename;
cout << "\nPlease type exact name for the name of the program" <<endl;
cout << "\nThere are 3 choose of program" <<endl;
cout << "\n1) FORCES1.DAT " <<endl;
cout << "\n2) FORCES2.DAT " <<endl;
cout << "\n3) FORCES3.DAT " <<endl;
cin >> filename;
ifstream infile;
infile.open(filename.c_str());
//-------------------------------if program fail--------------------------------
if (infile.fail())
{
cout << "\nError! Please enter exact filename" <<endl<<endl;
system("pause");
exit(1);
}
cout << "\nThe filename you enter is successfully open" <<endl;
//----------------------The file the run from this matrix-----------------------
int Row = 0;
do
{
for(int i = 0; i < 4; i++)
infile >> value[Row][i];
Row++;
}
while(infile.eof()!= 1);