Driver program to test above function
int main ( ) { char str1 [ ] = " ad " ; cout << " Input ▁ = > ▁ " << str1 << " Output = > " stringFilter ( str1 ) ; cout << str1 << endl << endl ; char str2 [ ] = " acbac " ; cout << " Input ▁ = > ▁ " << str2 << " Output = > " stringFilter ( str2 ) ; cout << str2 << endl << endl ; char str3 [ ] = " aaac " ; cout << " Input ▁ = > ▁ " << str3 << " Output = > " stringFilter ( str3 ) ; cout << str3 << endl << endl ; char str4 [ ] = " react " ; cout << " Input ▁ = > ▁ " << str4 << " Output = > " stringFilter ( str4 ) ; cout << str4 << endl << endl ; char str5 [ ] = " aa " ; cout << " Input ▁ = > ▁ " << str5 << " Output = > " stringFilter ( str5 ) ; cout << str5 << endl << endl ; char str6 [ ] = " ababaac " ; cout << " Input ▁ = > ▁ " << str6 << " Output = > " stringFilter ( str6 ) ; cout << str6 << endl << endl ; char str [ ] = " abc " ; cout << " Input ▁ = > ▁ " << str << " Output = > " stringFilter ( str ) ; cout << str << endl << endl ; return 0 ; }