Question: #include #include #include #include using namespace std; void readFile(string inputFileName, string *words, int num){ ifstream fin; char *p = &inputFileName[0]; fin.open(p); for (int i =

#include #include #include #include

using namespace std;

void readFile(string inputFileName, string *words, int num){ ifstream fin; char *p = &inputFileName[0];

fin.open(p);

for (int i = 0; i

}

void writeFile(string outputFileName, string *words, int num){ ofstream fout; char *p;

p = &outputFileName[0]; fout.open(p); for (int i = 0; i

}

int main(int argc, char **argv){ //Check correct number of arguments if (argc != 5) { cout

//Handling cmd line args //YOU MUST INITYIALIZE THEIR VALUES string inputFileName = argv[1]; string outputFileName = argv[2]; int numberOfWords = atoi(argv[3]); char *lettersToReplace; char *p; int found;

//Checking valid input if (numberOfWords

I have this code, but I need to create a replaceWords function as instructions show. How can I do this? This language is c++. Please add the replaceWords function to the current code. #include #include #include #include using namespace std; void readFile(string inputFileName, string *words,int num){ ifstream fin; char *p = &inputFileName[0]; fin.open(p); for (int i= 0; i } void writeFile(string outputFileName, string *words, int num){ ofstreamfout; char *p; p = &outputFileName[0]; fout.open(p); for (int i = 0;

Here is the main function that you must use. You may not add or remove parameters or change the names of the variables. You must initialize the values of the variables.: int main (int argc, char argv)t //Check correct number of argument:s if ( argc != 5 ) { cout

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!