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.
void Main()
{
const char * managerfile = "c:/manfile.txt";
clrscr();
char line[100]; //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;
getch();
managerfile.close(); //is this correct and necessary??
}