Hello, part of my project I'm working on needs to have me count the amount of letters in a file. This is what I have so far. Any one help?
#include <iostream>
#include <fstream>
using namespace std;
int main ()
{
char c ; // start with a blank
int i;
int count[111] = {0};
int sum=0;
do
{start:
c = cin.get() ;
c = tolower(c);
{
{for(i = 97; i < 100; i++)
{ if (c==(char)i)
{count[c]=sum++;
goto start;}
}
}
}
for(int x= 97; x < 100; x++)
{
cout<<(char)x<<" = "<<count[x]<<endl;
}
}
while (c != EOF) ;
return 0;
}