I'm trying to compare two data files character by character to see if they are the same. If the files are different, the program should print out the line numbers of where they do not match. So far, I have the part where it returns 'T' for when the files are the same and 'F' when they are not. But how should I start where the program prints out the line number where the characters are different? I am thinking of an array but nor sure how to start it.
You could store the current line number in a int variable. If you read the files line by line using getline you just increment this variable for each new line. If you read the file char by char you could test if the char is equal to '\n' and increment the variable if is.