I'm trying to make a program that reads a file (manfile.txt) and then displays to screen certain lines.
The below example doesn't seem to work, but i'm trying to get the program to display the 10th line of the file, any ideas why it doesn't seem to work?
Also I have a few query's by the side of the code.
const char * managerfile = "c:/manfile.txt";
char line; //is the number in square brackets to total number of lines the program reads??
ifstream managerfile (managerfile, ios::in);
managerfile.getline( line, 10 , '\n' ); //not 100% sure if the code in the brackets is correct.
cout << line;
managerfile.close(); //is this correct and necessary??