I have a constructor which takes in a reference variable of type ifstream. I want to be able to define a file which to get one line of text from and then use the created ifstream to read that one line in the constructor. Something like this:
1 2 3 4
int main(){
ifstream myStream(FILENAME);
PegBoard newGame(myStream);
}
In my constructor I want to read that one line:
1 2 3 4
PegBoard::PegBoard(ifstream & sin){
// How would I read that one line in this constructor?
}