How to read from files with windows.h?

So, I am gonna keep trying, I haven't done this in a while and forgot how to do it, but anyway, I am reading from a file ("file.txt") and storing it into a char or something. I used OpenFile like this:
 
HFILE nameBase = OpenFile("file.txt", NULL, OF_READ);


Am I using it right? I don't really know what to do next. I can't find it in the 1400 page book I have, and I know its in there, but I will keep looking. I will let you know if i find it.
Unless you have good reason to do otherwise, use the standard C++ library version.

am reading from a file ("file.txt") and storing it into a char or something.
You have to decide what that something is.

But if you wanted to read and process lines from the file, the code might look like this:
1
2
3
4
5
6
std::string line;
std::ifstream is("file.txt");
while (std::getline(is, line))
{
    // process line
}
Ok, I was gonna do fstream, but I felt like trying to be elaborate and learn something new. Thanks anyway!
Topic archived. No new replies allowed.