You are here:

C/C Program for comparing two text files which are not in sequence

Advertisement


Question
I need to write a C program to compare two files not in the same sequence.

ie. Take one line from first file....compare with all lines in second file....If there is no match....put it in a third file

If there is any match ...leave that line...and go to the second line in the first file....again compare with all lines in second file.

Continue the same procedure till we reach the end of the first file.  

Answer
OK. The problem is very clear.
So, have you started writing the algorithm for this?
If yes, then do complete it and then go to write the C code.
If not, then start writing the algorithm.

If you are ready with the code and facing some problem with that, then please do post it here and I will try to help you with that.

-Narendra

C

All Answers


Answers by Expert:


Ask Experts

Volunteer


Narendra

Expertise

I can answer questions in C related to programming, data structures, pointers and file manipulation. I use Solaris for doing C code and if you have questions related to C programming on Solaris, I will be able to help better.

Experience

6.5

Organizations belong to
Sun Microsystems

Awards and Honors
Brain Bench Certified Expert C programmer.
Advanced System Software Certified

©2012 About.com, a part of The New York Times Company. All rights reserved.