CbeginnercliAI generated

Text File Statistics Tool (wc clone)

A command-line utility that counts lines, words, characters, and longest line length across one or more text files, mimicking core wc functionality plus extra stats. Learners practice file I/O with fopen/fgetc, command-line argument parsing, and buffered reading in C.

Estimate
~6.5h
Steps
5
Completed by
0
Proposed by
codeseed.app

stdio.h · getopt

Project roadmap

  1. 01

    Implement single-file counting logic

    ~1.5h

    Write a function that reads a file character by character and tallies lines, words, and characters.

  2. 02

    Add longest-line tracking

    ~1h

    Extend the counting loop to track the length of the longest line encountered.

  3. 03

    Support multiple files and totals

    ~1.5h

    Loop over multiple filename arguments, printing per-file stats and a combined total row.

  4. 04

    Add getopt-based flags

    ~1.5h

    Support -l, -w, -c, -L flags to selectively print only chosen statistics, matching wc's interface.

  5. 05

    Handle stdin input

    ~1h

    When no filename is given, read from stdin so the tool works in pipelines.

Ready to build this?

Get a GitHub repo and start building. Your AI reviewer checks each step as you go.

~6.5h · 5 steps

Tech stack

stdio.hgetopt