Help with I/O file program

I have the description of the code here, but I have absolutely no idea how to program it. HELP!!!!

//Create a C++ program that prompts the user for an input filename.
//The first number of the file will be a count of the remaining numbers in the file.
//The program will then read these numbers and print to the screen the minimum, maximum,and average values of the numbers read in.


using namespace std;

cout << "Enter filename: " << endl;

ifstream infile("numbers.txt");

cout << numbers.getline(0); << endl;
ok, let's start from the... start.
first, i believe you should use the string lib to be able to handle words easily.
#include <string>

then, create a variable to hold the filename:
string filename;

and store the user input in that string:
getline (cin, filename);

now, i don't remember how to count characters in the file. but i believe that you'll find this information on fstream documentations. maybe this could help you.
Topic archived. No new replies allowed.