#include // argc is number of paramters, argv are comand line options // main is int cause or returning error code int main(int argc,char * argv[]) { if (argc<2) cerr << "Usage -- readpsv root" << endl; //uistream uis(argv[1]+adstring(".psv")); uistream uis( (char*)(argv[1]+adstring(".psv")) ); if (!(uis)) { cerr << "Can't open file" << argv[1]+adstring(".psv") << endl; exit(1); } int nvar; uis >> nvar; dvector x(1,nvar); uis >> x; while (!uis.eof()) { if (!(uis)) { cerr << "Error reading x" << endl; exit(1); break; } cout << setprecision(16) << x << endl; uis >> x; } exit(0); }