How to give input file?

hey guys i wana know how to give an input file to a program? and get back an output file...?
thanks
What do you mean? Will the program prompt the user for the name of a file?
yes or the name of file is given in the program by using fstream.....
Here's an example:
1
2
3
std::string infilename;
std::cin >> infilename;
std::ifstream infile(infilename);//open file with the name infilename 
Topic archived. No new replies allowed.