This what i have so far im not sure exactly how to make the getline send the line to the array . i dont want to display the array just be able to search the arrays for information
that fixed it but i still got an issue. but when i run the search and enter a correct student id thats in file the display works correctly only for the last student id entered not any that have been entered. if that makes more sense.
while (!myfile.eof())
{
getline(myfile, line);
string studentarray[] = { line };
}
Every time you go round this loop, you are creating a new array of strings named studentarray, putting something in it, and then when the loop ends and you go round again, destroying it.
Create the array of strings once, before the loop. Add to it each time you go round the loop. Also, don't use an array. Use a vector<string>