Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C/C++ Programming in a UNIX Environment. [50] Write a C program to count the total number of commented characters and words in a C file
C/C++ Programming in a UNIX Environment.
[50] Write a C program to count the total number of commented characters and words in a C file taking both types of C file comments (single line and block) into account.
- You should count what is inside or follows the comments (// and /* */)only. You can assume that comments have been added correctly. The // comment continues until a newline and /* ends with */ sequence.
- Whitespace characters (tabs, spaces, newlines) should be counted.
- The program simply allows user redirect a C file as input. $./a.out < infile.c
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