FreewareFire Posted July 2, 2004 Posted July 2, 2004 Hi guys, i've 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 Quote
HJB417 Posted July 10, 2004 Posted July 10, 2004 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) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.