Question: In C++ Task B. Counting blocks opened and closed by and adding real indentations f and ] To count open blocks, we need to count
In C++

![real indentations f and ] To count open blocks, we need to](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3afc30283f_27466f3afc29379c.jpg)
Task B. Counting blocks opened and closed by and adding real indentations f and ] To count open blocks, we need to count how many curly braces get opened and closed on each line, so we need to count and) Write a function t countchar(string line, char c); that scans the line and returns the number of occurrences of the character c . Write a new program indent.cpp that enhances the program from the previous task. As it reads the input line by line, it should also count the number of open and closed in it, and keep track of how many blocks is currently open at the beginning of each line. In the listing below, the number of open blocks is shown on the left: 0 int main() 1 Hi, I'm a program! 1 int x = 1; 1 for(int i = 0; i 10; i++) { 2 cout
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
