Hello,
I am working on a project where if need to compare a multiple strings from a file and it needs to compare the first word with the following words on the line. I need to compare the strings and find out if two characters positions are swap within the string and then output what it is. I have found all the other possibilities that I need, but I unable to figure out this one. If anyone has any ideas it would be greatly appreciated. (A transposition example would be Their and Thier)
Heres a sample that i have to read from
I think a solution might me: read all the strings and memorize them in an array of strings (char*) and then to compare them with an inbricated loop. You can read them from the file in a while loop with the condition: while(!fin.eof()). The fgets function should work properly.