#include /* cout etc */ #include /* srand, rand */ #include /* time */ #include using namespace std; int main(int argc, char** argv){ cout << "*** Starting test program! ***" << endl; if(argc != 2){ cout << "Wrong type of parameters given. Please type >>./Example filename<<" << endl; return 1; } // get the filename and give it out to terminal string filename = argv[1]; cout << "The file >> " << filename << " << will be created" << endl; // create a random number generator srand (time(NULL)); // create an output file ofstream myfile(filename.c_str()); for(int i = 0; i < 10; i++){ myfile << i << " " << rand() << endl; } myfile.close(); cout << "*** Program finished! ***" << endl; return 0; }