Answered step by step
Verified Expert Solution
Link Copied!

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.

  1. 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.
  2. Whitespace characters (tabs, spaces, newlines) should be counted.
  3. 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 10g SQL

Authors: Joan Casteel, Lannes Morris Murphy

1st Edition

141883629X, 9781418836290

More Books

Students also viewed these Databases questions

Question

4-44. Management (inaugurated) the recycling policy six months ago.

Answered: 1 week ago