Giter VIP home page Giter VIP logo

word-count's Introduction

Word-Count

This was a fun warmup/teaser for one of my classes. We had to create our own version of the unix tool wc aka word count.

To run this program it needs to first be compiled.

Ex) gcc mywc.c -o mywc

It then can be run by feeding it a text file like so: ./mywc < hello.txt.

The program will then print out to the console how many lines, words, and characters the file contained.

In the case of the provided hello.txt: 1 line(s) 10 word(s) 44 character(s)

It gets 44 characters by counting the all of the letters in the statement along with spaces, punctuation marks, tabs, newlines, etc in the file. To get an accurate line count make sure you press enter after the last character on the last line of the document. If you don't go to the next line, there will be no newline character and the line count would be one less than it should be. So for example you would want to press enter after this period ->.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.