So what answers ARE you getting?
I can help by reposting your code with some decent indentation.
Code:
int main()
{
char text[50];
char *searchPtr;
char character[26] = { '\0' };
int count = 0;
int i, j;
cout << "Enter strings: \n\n";
while (cin.getline(text, 50)) {
for (i = 0; text[i] != '\0'; i++) {
text[i] = tolower(text[i]);
}
for (i = 0; i <= 25; i++) {
for (j = 0, count = 0; j <= 50; j++) {
searchPtr = &text[i];
while (searchPtr = strchr(searchPtr, 'a' + i)) {
++count;
searchPtr++;
}
}
character[i] = count;
}
}
cout << endl << endl;
for (i = 0; i <= 25; i++) {
cout << "("
<< (char) ('A' + i)
<< " , "
<< (char) ('a' + i)
<< ") = "
<< character[i]
<< endl;
}
cout << endl;
system("pause");
}
The only instantly odd thing I can see is using a char array to COUNT things.
It's not that you can't, it's just that they will be output as chars (and not numbers).