subject

Implement the function charCnt. charCnt is passed in a name of a file and a single character (type char). This function should open the file, count the number of times the character is found within the file, close the file, and then return the count. If the file does not exist, this function should output an error message and then call the exit function to exit the program with an error value of 1.
USE THIS CODE TEMPLATE PLEASE
#include
#include
#include
using namespace std;
// Place charCnt prototype (declaration) here
int main() {
string filename;
char ch;
cout << "Enter the name of the input file: ";
cin >> filename;
cout << "Enter a character: ";
cin >> ch;
cout << "# of " << ch << "'s: " << charCnt(filename, ch) << endl;
return 0;
}
// Place charCnt implementation here

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:20
Avariable of the data type arrays is storing 10 quantities. what is true about these quantities? a. the quantities all have different characteristics. b. the quantities all have the same characteristics. c. five quantities have the same and five have different characteristics. d. it is necessary for all quantities to be integers. e. it is necessary for all quantities to be characters.
Answers: 2
question
Computers and Technology, 23.06.2019 04:31
Type the correct answer in the box. spell all words correctly. the managing director of a company sends a christmas greeting to all his employees through the company email. which type of network does he use? he uses an
Answers: 1
question
Computers and Technology, 23.06.2019 11:20
Http is the protocol that governs communications between web servers and web clients (i.e. browsers). part of the protocol includes a status code returned by the server to tell the browser the status of its most recent page request. some of the codes and their meanings are listed below: 200, ok (fulfilled)403, forbidden404, not found500, server errorgiven an int variable status, write a switch statement that prints out the appropriate label from the above list based on status.
Answers: 2
question
Computers and Technology, 23.06.2019 16:30
20 points archie wants to use a reflector as he photographs a newlywed couple. what would he consider in his choice? a. shadow and sunny b. homemade and professional c. lamps and boards d. incident and reflected e. neutral density and enhancement
Answers: 3
You know the right answer?
Implement the function charCnt. charCnt is passed in a name of a file and a single character (type c...
Questions
question
World Languages, 03.01.2020 11:31
question
Mathematics, 03.01.2020 11:31
Questions on the website: 13722367