i have below code , now i want to calculate the frequency of each letter which a function contain an array of alphabets use Pointer to a function principle
i want to use pointer to find Frequency .... i have a little bit information about pointer but i don't know how to use it in this question
-----------------------
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main (){
char ch;
int c_tch=0,c_up=0,c_lo=0,c_sp=0,c_n=0,c_sym…
ifstream fileName;
fileName.open("a.txt");
while (fileName.get(ch)){
if (ch<=52)
c_tch++;
if(isupper(ch))
c_up++;
if(islower(ch))
c_lo++;
if(isspace(ch))
c_sp++;
if(isdigit(ch))
c_n++;
if(ispunct(ch))
c_sym++;
}
cout<<"Total Number Of Characters: "<<c_tch<<endl;
cout<<"Total Upper case: "<<c_up<<endl;
cout<<"Total Lower case: "<<c_lo<<endl;
cout<<"Total Space: "<<c_sp<<endl;
cout<<"Total Numeric: "<<c_n<<endl;
cout<<"Total Symbols: "<<c_sym<<endl;
fileName.close();
return 0;}