I've got some silly questions about some basic IO stuff I should probably know to be fair.
I'm using ifstream to access a binary file for read.
My question is, how do I read different types, using fstream? Am I stuck to char arrays?
It's a 3ds file, so it's hierarchically chunked, with headers and bodies. I need to be able to read x amount of bytes, and convert it to a given type, i.e. an unsigned short or an unsigned int, or an array of floats, or even chars, say.
Can I use something like the following?
void*
Parser::temp_buffer;
// ..read two bytes into the buffer.. somehow without passing a char*
// then..
chunk->ID = (unsigned short) temp_buffer ;
Or do I just have to wrap up a bunch of FILE* and fread functionality to do this?
Also, how do I store the current file pointer position as a member of a static class?
Thanks in advance