Question: Write a function to accept a vector of chars and a char and return a count of how many times the char appears in the
Write a function to accept a vector of chars and a char and return a count of how many times the char appears in the vector.
Choose the answer below that best implements this function.
int countCharconst vector &V char ch
int count;
forint i ; i Vsize; i
if Vi ch
count;
return count;
None of the other answers are correct.
int countCharconst vector &V char ch
int count ;
forint i ; i Vsize; i
if Vi ch
count;
return count;
void countCharconst vector &V char ch
int count ;
forint i ; i Vsize; i
ifVi ch
count;
cout "The count is count endl;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
