This is what you need to do:
1)create a buffer to store one line of text from the file
2)open the file for reading
3) test the stream to make sure it is open
4) read one line from the file
5) test for end of file
6) if end of file, quit
7) else increment line count, goto 4
Hints:
1) use: char line[256]; for the buffer
2) use: int count=0; to hold the line count
3) use: if(in) to test the stream for open state
4) use: while( in.getline(line, 256, '\n')) to read from the file and test for end of file in one line of code;
5) use: ++count; to increment the count
I gave you a lot of big hints because you are very new at C++. See if you can put this "old school" code together.
edit:
you can get the users input like this
Code:
char filename[MAX_PATH]; // need a place to put the filename
std::cout << "filename: ";
std::cin >> filename;
// use filename to open the stream
Rog