Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Description In this lab we wl be (partially) re-creating one of the core Unix programs, c, which stands tor word count.This program reads text files

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Description In this lab we wl be (partially) re-creating one of the core Unix programs, c, which stands tor word count.This program reads text files and counts the number of words, characters or lines In this lab, l the input for your program will be given via the command line. See the material for Week 11 on Carmen for a reminder on how to use command line arguments. Your program will not be given any input via stdin, you should not use scanf or any other function that reads stdin. Command Line Usage The first argument for your program will be the operation mode of the program, specifying whether you'll be counting words, characters or lines. This argument can be for lines, or -c' for characters, or'-w' for words. The first argument to your pro- gram will always exist and will be one of these options The remaining arguments to your program are the filenames of the files you need to read. Yo need to open these files read them in whatever method you find suitable; and count the number of lines, characters or words depending on the first option. You should make sure to close the files as soon as you are done reading them

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_2

Step: 3

blur-text-image_3

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

Database Administrator Limited Edition

Authors: Martif Way

1st Edition

B0CGG89N8Z

More Books

Students also viewed these Databases questions

Question

Developing and delivering learning that is integrated with the job.

Answered: 1 week ago