Harsha <ha********@gmail.comwrites:
bits in the sense i want to compare each binary bit of one file with
corresponding bit of other file, just forget about "secondary memory"
here...thank you...
*Please* provide context when you post a followup. Don't assume that
anyone has seen, or can see, the previous article. Read
<http://cfaj.freeshell.org/google/>.
Your original question was:
| This may sound a bit novice ( because i am), could you please
| tell the procedure to compare bits of two different files stored on a
| secondary memory......
You say you want to compare "each binary bit". The word "compare"
doesn't mean much by itself if you don't specify what you want to do
with the result of the comparison. Do you care about whether each
individual bit is equal to the corresponding bit in the other file
(and if so, what do you want to do about it), or do you just want to
know whether the files as a whole are identical?
If you just want to know whether the files are identical, you can read
data from each into a buffer using fread(), and compare the buffers
using memcmp(). If that's not what you're looking for, you'll have to
ask a more specific question.
A concrete example, showing both input and desired output, would be
helpful.
--
Keith Thompson (The_Other_Keith)
ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"