binary file read/write function ?

which function should i use, to read data from binary file..


inFile.read(static_cast<char *>(&obj), sizeof(obj));

inFile.read((char *)&obj, sizeof(obj));

inFile.read(reinterpret_cast<char *>(&obj), sizeof(obj));

What would be a better way read binary data. why static_cast or reinterpret_cast is used?

Topic archived. No new replies allowed.