Wow, that code will not even compile. c is an int variable. So you cannot access it like a pointer/array as you have in that code. That's just the most glaring error in the code, I am sure there are other problems too.
Can you restate exactly what it is you are trying to do here?
[Edit]
~~~~~~~~
If you just want the length of your string, it's just one line of code to do that:
string s = "test";
int count = s.length();
[Edit 2 ]
~~~~~~~~~~
Based on your updated requirements not to include space and dot, here's what you can do:
string s = "This is a test.";
int count = s.length();
string::iterator it;
int filteredCount = 0;
for (it = s.begin(); it != s.end(); it++)
{
if(*it != ' ' && *it != '.')
{
filteredCount++;
}
}