Hi there
I am working on a code where from command line user gives the name of the file in which output should be written. The file name is in array av[4]. I am unable to figure out how to make a file by the name stored in av[4] and write simple integer data in to the file.
#include <fstream>
int main(int argc, char *argv[])
{
usingnamespace std;
ofstream outputfile(argv[4]); // open file, assume argv[4] is valid
outputfile << "some text" << end; // write some text to the file
return;
}