How do I read lines from a text file and store them into an array. For example I have a text file with 45 different lines.
My attempt:
int main()
{
    int a[45];
    ifstream myfile("enroll_assg.txt");
    if(!myfile){
        cout << "Error opening file" << endl;
        return -1;
    }
    if(myfile.is_open()){
        while(getline(myfile, a, '\n') == 1){
        }
    }
}
I am supposed to make a hash table with this. I get a error in the while loop at the getline(). It is saying "no instance of overloaded functions".
I have 45 lines and each line has white space. Each line looks like:
9650376 George Jones CS 4.5 ... ...
Student.cpp:
template <typename Comparable>
Student<Comparable>::Student()
{
    // Add your code
    this->fname = fname;
    this->lname = lname;
    this->gpa = gpa;
    this->department = department;
    this->id = id;
    this->bucketId = bucketId;
}
The student.cpp also has the getters and setter for the variables.
 
    