CFile and integer/bit problem

FreewareFire

Active member
Joined
May 23, 2003
Messages
28
Hi guys,

ive a little problem - i use the CFile method to read a binary file.
My problem is that i need to read the first byte of the binary file and check if the first bit is set!

For example the file contains in hex 8020, i need to know, if the bit of the 80 is set... only with CFile; no fopen or something else...

So the thing is, read in the first byte and convert it from char to int and check...

could someone give me a little code for?

So many Thanks for! :D
 
1st) go here for some info on how to manipulate a cfile object

Do a read of 1byte.

Lets say you store it in to a variable of type char named value

To see if the 80 is set,
bool isSet = (8 & value)
 
Back
Top