Accessing external files, how?
Sorry about the nooby question, but I'm still working on that fraction calculator mentioned in the last thread, and I need to know how to do the following:
-> Make my program acess an external file
-> Check that the value of one of two variables don't match any in the external file.
Each line of the external file contains a number.
At the moment, the external file is a txt document, however it's easy enough to change.
Sorry about such a nooby question btw
Thx in advance,
-Cobrah
Re: Accessing external files, how?
Use an object of class std::ifstream to open and read the file. I'm sure you will find a class reference and examples on the net (including this forum).