Frnd!
Try this!
# include <iostream>
#include "afxwin.h"
using namespace std;
int GetCount(char a,CString s);
int main()
{
CString s = "aaabbcdfaeaaaeeeeeeeeeeeeeeeeeeeea";
int nCount_a = GetCount('a',s);
cout << nCount_a << endl;
int nCount_e = GetCount('e',s);
cout << nCount_e << endl;
}
int GetCount(char ch, CString str)
{
int nCount = 0;
int n = 0;
for(int i = 0; i < str.GetLength(); i++)
{
if ( str.Find(ch,i) == i)
{
nCount ++;
}
}
return nCount;
}</iostream>