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, vc, which stands for 'word count'. Thi text files and

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, vc, which stands for 'word count'. Thi text files and counts the number of words, characters or lines s program reads 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

Practical Azure SQL Database For Modern Developers Building Applications In The Microsoft Cloud

Authors: Davide Mauri, Silvano Coriani, Anna Hoffma, Sanjay Mishra, Jovan Popovic

1st Edition

1484263693, 978-1484263693

More Books

Students also viewed these Databases questions

Question

If you were Dans friend, what might you say to alter his behaviors?

Answered: 1 week ago