I wanted to input a word and have it match another word and print out the miss matched letters in a different color. for example if its matching the word "hello" and I type "holino" I want it to print out "hello" with the el in a different color. the example below only compares two words and prints out the letter in different color but if the miss spelled word is larger or shorter then the the word that is being compared to it wont work. how can i get it to work?
char first_word[]="hello";
char defintion[]="holino";
int word_length=5;
for (int loop=0; loop<word_length; loop++)
{
if (first_word[loop]==defintion[loop])
{
cout <<first_word[loop];
What you got there is a form of the longest common subsequence problem. Check if the letters are or not part of the subsequence and color them accordingly.