Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted

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)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...