Please help me with this c++ code. I need to print out thenumber of digits,total characters, and number of letter usingpointer. In particular, I’m having a hard time initializing thecharacter array. I have my code here.
#include <iostream>
#include <string>
using namespace std;
void getStatistics(char sentence[], int* noOfChars,int*noOfDigits,int* noOfAlphabets);
int main()
{
int noOfChars;
int noOfDigits;
int noOfAlphabets;
string sentence = “”;
int stringLen = 0;
cout<< “Enter a sentence to analyze:”;
cin >> sentence;
char* sen[] = new char[sentence.length()-1];
for(int i = 0; i < sentence.length()-1; i++){
sen[i] = &sentence[i];
}
getStatistics(sen,&noOfChars,&noOfDigits,&noOfAlphabets);
cout<< noOfChars << endl;
cout<< noOfDigits << endl;
cout<< noOfAlphabets << endl;
return 0;
}
void getStatistics(char sentence[], int* noOfChars,int*noOfDigits,int* noOfAlphabets){
for(int i =0; i <sizeof(sentence)/sizeof(sentence[0]);i++){
if((sentence[i] >= 97 && sentence[i] <= 122)
PayPal Gateway not configured
PayPal Gateway not configured