1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
void charactSummary(char counterArray[], char& setOfChar)
{
counterArray[26] = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
//this counterArray keeps showing an error message of "expected primary-expression before '{' token."
//any ideas as to what I'm doing wrong. Very Very new at c++.
char charSum;
int counter;
counterArray[0] = 'a' - 97;
for(charSum = 'a'; charSum < 'z'; charSum++)
{
counter = 0;
counterArray[charSum];
if (setOfChar == counterArray[charSum])
{
counter++;
}
}
for(charSum = 'a'; charSum < 'z'; charSum++)
{
cout << counterArray[charSum] << " = " << counter << endl;
}
}
|