1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
if(use==1) //is set to 1 if the word is legal, 0 if not
{
if(strncmp(m_WordsString, '.', 1)==0) //add the period
{
strcat(m_NewString, m_WordsString); //word is legal
strcat(m_NewString, " ");
strcat(m_OriginalString, m_WordsString); //the original string contains all input
strcat(m_OriginalString, " ");
}
else //Add the word if it is not punctuation
{
strcat(m_NewString, " ");
strcat(m_NewString, m_WordsString, strlen(m_WordsString));
strcat(m_OriginalString, " ");
strcat(m_NewString, m_WordsString);
}
}
else //if use=0
{
if(strncmp(m_WordsString, '.', 1)==0)
{
strcat(m_OriginalString, m_WordsString);
strcat(m_OriginalString, " ");
}
else //Add the word
{
strcat(m_OriginalString, " ");
strcat(m_OriginalString, m_WordsString);
}
}
|