I'm learning programming and I can't make this script work. I opened 2 files and I want to go thru them and find out, if there are same or how many characters are different. But none of the cycles bellow work. Can you tell me, what I have done wrong? Thank you.
(I'm 100% sure that the problem lies here)
c and v should be of type int because EOF can't be represented by a char.
The first code looks more correct but it will fail to notice if the files have different sizes. If you want to increment diff once for each extra byte that the other file have you can just change the && to ||.