Question: C++ coding. please help me fix code for correct output. this program that counts chars in array. the program is able to count the a's
C++ coding. please help me fix code for correct output. this program that counts chars in array. the program is able to count the a's and b's but for some reason not c's. Please fix error and explain.
| Expected input: 10 aaaabbbccc Expected output: aaaabbbccc a4b3c3 |
| current output: aaaabbbccc a4b3 |
current code:
#include
int main(){ int size; cin>>size; char* arr =new char[size];
for(int i =0; i } } return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
