Write your own version of wc

Assignment Help C/C++ Programming
Reference no: EM131137823

This program needs to be written in C. wc is another standard UNIX command for counting the number of lines, words, and characters in a text file.

Now that we know how to read files, you're going to write your own version of wc. Your program is to receive a text file as a command line argument and then count and display the number of lines and characters in that text file.

Assume a line is a newline character.

Sample Run: Command Prompt$ ./a.out file.txt Lines: 2 Characters: 23 Where file.txt contains: hello how are you? rawr

Reference no: EM131137823

Questions Cloud

Write a program that takes four command line arguments : Write a program that takes four command line arguments: start, stop, step, and file. The first three arguments are nonnegative integers and the fourth is a string.
Calculate the hydraulic conductivity of this clay : A falling-head permeability test was carried out on a clay soil of diameter 10 cm and length 15 cm. In 1 hour the head in the standpipe of diameter 5 mm dropped from 68 cm to 50.2 cm.
What effect do the closing costs have on the effective a i r : The bank charges $4,000 for closing costs on a $200,000 loan with an annual percentage rate of 8.5% compounded monthly with a term of thirty years. The bank will not allow the closing costs to be added to the $200,000 borrowed. What effect do the clo..
Draw an as ad diagram : The Economy cannot be considered fully employed unless the measured unemployment rate is below 1%. Agree or disagree and explain your answer in a paragraph.
Write your own version of wc : Write your own version of wc. Your program is to receive a text file as a command line argument and then count and display the number of lines and characters in that text file.
Determine the flow (qi) into the excavation : The excavation has to be kept dry. Determine the flow (qi) into the excavation
How much interest is paid over the life of the loan : How much interest do the borrowers in Problem 12 pay during the second year of the loan? In Problem 12, determine the monthly payment for a sixty-month truck loan with an annual percentage rate of 11% and an initial principal of $17,000. How much int..
What subjective factors would affect investment decision : Assume that the before-tax required rate of return for Deer Valley is 14%. Compute the before-tax NPV of the new lift and advise the managers of Deer Valley about whether adding the lift will be a profitable investment
Which data is at the bottom of the heap : Which data is at the bottom of the heap - Now remove the 2, 3, and 4, from your heap in above question, then which data is at the root:?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  The initial data structure with information about a service

Implement a program using function for a defined task. Initial data is read from a file and added from keyboard. Program has to output initial and resulting data.The initial data structure with information about a service:

  Calculate compounded monthly interest

So for example if I were to have an initial balance of $1250.00 with an interest rate of %13 paid over the course of 4 months it should come out to $2038.09 total for interest added to the initial balance

  Feature of object-oriented programming

Describe at least one (1) feature of object-oriented programming that Visual Logic lacks and Identify at least one (1) advantage to using event-driven programming, as compared to using purely procedural programming

  Evaluate the restriction of assembly

1. Evaluate the restriction of Assembly. Make all computations and note the value of X and Y. 2. Evaluate Restriction Test. Make all computations and note the value of X and Y.

  Maintenance personnel of flyhigh airlines

Create a new class named view Maintenance that allows the maintenance personnel of FlyHigh Airlines to view the maintenance details of aircrafts. Write the code snippet that the development team should use to accomplish each of the preceding tasks..

  Prepare a main function

Write a function that converts an input of some integer number of nickels into outputs of integer numbers of dollars, quarters, and nickels.

  Use numbers 0 through 23 to represent hours

Write a C function seconds_since_jan1() that takes the time as six integer arguments (year, month, day, hour,minute, and second) and returns the number of seconds since the beginning of the year. Use numbers 1 through 12 to represent months. Use numb..

  Statements that return container data only return container

Make sure all return statements that return container data only return container data.  If a return statement returns container data under certain conditions, but another return statement returns something that is not container data under other condi..

  Write a function printshampooinstructions with int parameter

Write a function PrintShampooInstructions(), with int parameter numCycles, and void return type. If numCycles is less than 1, print "Too few."

  Generic binary tree using java generics

In this project you will create a generic binary tree using Java Generics.

  Create an order application

Create an Order application that prompts the employee for the number of burgers, fries, and sodas and then display the total, the tax (6.5%), and the final cost.

  Program that calculates and prints average of several grades

Write a C program that calculates and prints the average of several grades entered by the user. The program should first prompt the user to enter the number of grades to process (at least 2 grades must be entered by user!)

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd