Answer the question
In order to leave comments, you need to log in
How to do it correctly? File comparison?
The trick is: you need to make a program that makes a difference between two files ... If text files are input, then character by character, and if binary, then byte by character ..
If character by character, then you need to output the line in which the first mismatch and display a plus between the lines where the difference is . You need to output in this format: example
abcd
++
attd
And let's suppose there are two files:
Let's say there are two files:
1)
```
tttt
tttt
abcd
2)
```
tttt
tttt
attd
```
It is necessary to output
abcd
++
attd
How to do it correctly? Calculate offset when the mismatch started (relative to the read buffer) and print starting from there? or how? How nice would you do
Answer the question
In order to leave comments, you need to log in
Calculate offset
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question