Read the given file (HW3P2.txt), and output the contents to another file output.txt with the
following modifications. Remove any 'a' or 'A' characters. Replace all newlines ('\n') with tabs ('\t').
So far, I have been able to replace the newlines with tabs. I have also removed some of the characters. However, only about half of the 'a' characters are removed. How can I remove all of them?
Here is a copy of the code I currently have:
#include<iostream>
#include<fstream>
#include<cstdlib>
using namespace std;
using std::ifstream;
using std::ofstream;
using std::cout;
// connect inStream to an input file with open
// connect outStream to an output file with open
void Homework3_Problem2(ifstream& inStream, ofstream& outStream);
This is the output file before and after I run the program.
BEFORE
The quick brown fox jumps over a lazy dog. A
cat ran away as the fox came around the bend.
Further down the road, a student was ta-
king an exam for his CS2433 class.
AFTER
The quick brown fox jumps over lazy dog. cat ran wy as the fox came around the bend. Further down the road, a student ws t-
king n exam for his CS2433 class.