Question: Goal You are asked to develop a C++ program that can count the occurences of a string in a text file. Consider, for example, the

Goal You are asked to develop a C++ program that can count the occurences of a string in a text file. Consider, for example, the following text file 2001 2002 2003 2004 2005 2006 2015 2015 If we save this file as file.txt and use our program to process it as follows, we will get the following output: $./sr file.txt 2014 Reading file.txt 2014" was found0 times. Similarly $./sr file.txt 2015 Reading file.txt 2015" was found 2 times The above examples suggest that your program can be used to count the occurence of a substring within a text file Furthermore that your program takes two arguments: 1) the name of the text file and 2) the substring to match. Programming considerations You are asked to use std::ifstream and std: :string to complete this lab. My sr.cpp file looks like this #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
