Hi, I'm trying to do a program where I have to input 4 lines of text from a txt file, char by char into 4 seperate arrays (1 for each line). I have this
ifstream input("c:\\p2input.txt");
for (int z = 0; z < 250; z++)
{
while (!input.eof())
{
input.getline(f, 250);
}
}
for (int c = 0; c < 250; c++)
{
cout <<f[c];
}
But it outputs the 4th line of text, followed by the second half of the third and then gibberish. Also, how do you get it to do just the second line, or just the third line? I'm using size 250 arrays because the lines cannot be more than 250 chars. Thanks.