Write Int???

Blitz3D Forums/Blitz3D Beginners Area/Write Int???

Hi,

This should work in C/C++

int bbReadInt( FILE *f ){
int n;
fread( &n,1,4,f );
return n;
}

void bbWriteInt( FILE *f,int n ){
fwrite( &n,1,4,f );
}

...with C++ you might need to use istream::get and ostream::put.

But I would recommned plain old 'C' FILE's for least hassles.