Question: Write a void C++ function that takes as arguments 2 strings (filenames), compares the two files and prints the lines that are not the same.

Write a void C++ function that takes as arguments 2 strings (filenames), compares the two files and prints the lines that are not the same. The function must be recursive, and it is possible for both files not to have the same number of lines.
File1.txt =
"Hi my name is John
I like to eat apples
they should be red
"
File2.txt =
"Hi my name is John
I like to eat bananas"
Expected output:
File1.txt: I like to eat apples
File2.txt: I like to eat bananas
File1.txt: they should be red
File2.txt:
File1.txt:
File2.txt:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!