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
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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started