Hi;
I have a number of text strings in an access db file. I want to compare those text strings with the user input. I need to make sure that atleast 60% of the text input matches with the correct string to declare it a correct answer. e.g.
for a string in access db "I would love to do that", if a user inputs something like " I love to do that" it should display "correct' message.
For simple comparison in MFC, I used
void CT2I::Correct(CString s)
{
CString str;
KillTimer(0);
m_ans.GetWindowTextA(str);
if(str == correct) // correct is acces db field with correct string)
{
score++;
MessageBox("CORRECT");
UpdateData(FALSE);
CString s;
s.Format("%d",score);
m_score.SetWindowTextA(s);
}
else
if(str != correct)
{
MessageBox("Wrong Input! Click 'OK' for Correct Answer",0);
m_ans.SetWindowTextA(correct);
}
Now I want to use CStringArray and want to assign two different lists for 'str' and 'correct' respectively but I am not able to work out with stricmp availible options. Something like this
CStringArray matchList;
CStringArray matchList1;
matchList.Add(str);
matchList1.Add(correct);
if (stricmp(matchList, matchList1) <0)
{
score++;
MessageBox("CORRECT");
}
else
{
..
...
}
Any suggestions/advices are welcome.