-
What is ifstream& for?
I have a classes project and one function I need inside of the class is called check(ifstream&). I am suppose to read from a text file and then check it against a set of data that is already written in memory. That check(ifstream&) is for the inputting of the data from the text file but I am stump on what to do with the ifstream&. What parameter do I put in that when I call it in main?
Please give me some insights on this. Thank you.
-
Open a file using ifstream and pass it to the function.
-
You may gain some benefit from reading through Lesson 10:File Operations to brush up on how files work with C++. Additionally, the & in this case specifies that the object will be passed by reference to the function.