Cstrings and strcat?

Hello all. I'm trying to use the strcat function with cstrings, but it wants me to use char*'s. This would be fine, except I'm using MFC and have declared cstrings as all of my edit box inputs. The program is supposed to check the input against three set words (called noise words), and if the input is one of those three words, exclude it from the final output. I have it check using strncmp, and it works fine, it's the next portion that I have trouble with.

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);
		}
	}


I take input one word at a time from m_WordsString, and then after the above process clear the contents of that edit box to get the next word. Is there an alternative to strcat that will work with Cstrings, or another workaround?
+1 @ hamsterman

Dont' use strcat when you can just use the += operator

1
2
3
//strcat(m_OriginalString, m_WordsString);

m_OriginalString += m_WordsString;
Well, I feel dumb now. Thank you guys!
Topic archived. No new replies allowed.