Problem: Write a program that uses a recursive function to return the number of occurrences of the digit 1 in a given binary string b. For
example, b = 100100010111 contains 6 occurrences of the digit 1. The result, the number of occurrences of the digit 1 in b, is output
to the screen, as part of the main function. Your submission should include a screenshot of the execution of the program using each
of the binary strings 001000001111, 000000000000 and 101001010000.
and here is code i had so far:
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int countOccurrences(string b, int index, int count);
int main()
{
int count = 0;
int index = 0;
string b = " ";
cout << "Enter a string: " << endl;