Miscellany
public text v1 · immutable#include <stdio.h>
struct basehdr_t
{
int id;
int version;
};
int main( int argc, char **argv )
{
FILE *fp = fopen( argv[1], "rb" );
basehdr_t *phdr = new basehdr_t;
fread( phdr, 1, 8, fp ); //only bother reading 8 bytes, it's all we need to get the version.
fclose( fp );
printf( "Version: %i\n", phdr->version );
delete phdr;
return 0;
}