You might want to consider reading the file into an array if it is not too long since that would be more efficient than reading it off of the disk a lot of times.
I believe that the easiest way to do this is to, first, figure out the size of the file, then declare a static array with the new operator. Then you can stream the file inro your array. An example of how to do this can be found here: http://www.cplusplus.com/ref/iostream/istream/seekg.html
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.