I have to do this for debugging purposes.In case if there are any differeneces between the files when comparison is done, it means that code has been updated somewhere.
I am stiull not clear how to start this.Could you please explain me more clear how to get started.Just have to make it simple comparison.
Please let me know if any questions.
Thanks.
But why reinvent the wheel? There are a bunch of utilities that do binary comparisons. Windoze uses FC, Unicies use diff.
Further, you could put a static char array at the beginning of each source and assign it to "Compiled: " __DATE__ __TIME__. It would make the object binary slightly bigger, but not only would you be able to compare the files faster (it should appear near the beginning of the object file if you make it appear at the beginning of the source file, allowing you to bail sooner when you find it), it would also tell you when it was modified.
An even faster method under Windozs is to use the archive file bit. Set all the files as archived by clearing the archive bit (use attrib /S -A * from the correct directory) and do a recompile. Any files that are modified will have their archive bits reset. (use attrib /S to find these or make your own utility).
More generically under Unix (or using Cygwin or MinGW under Windoze), create a new file (use touch to create it) and then do a recompile. From there you would do a time stamp comparison between the file you created using touch and the files in the compile directory (use test to do this comparison). All modified ones would have a date stamp that is newer than the file you created (unless your system clock is going backwards ;) :D)
These last two methods are much faster than comparing the files against each other because you are only checking the file attributes, not the entire file. You also don't have to make a copy of the original directory (unless you want to do that for backing up).
What OS, compiler and IDE are you using?
Adrian