English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I need to do a binary compare to compare two data files in C. I am not sure how to do this. Can I use memcmp for this? Thank you very much for the answer

2007-08-13 16:50:47 · 2 answers · asked by Anonymous in Computers & Internet Programming & Design

2 answers

Just load a buffer of data from file A into buffer A ...load buffer of data from file B into buffer B -- run memcmp and if there are no errors repeat until the file is complete. Otherwise you know the files are not the same.

2007-08-13 16:54:54 · answer #1 · answered by mdigitale 7 · 1 0

yes...

but, before to start, compare the size of file :)

and for fast compare.. use a buffer of 1/2 or 4k... (or also 8.. but depend from your environment/compiler)

2007-08-13 16:55:48 · answer #2 · answered by Anonymous · 0 0

fedest.com, questions and answers