CbeginnercliAI generated

RPN Command-Line Calculator

A calculator that reads Reverse Polish Notation expressions from the command line or stdin and evaluates them using a manually implemented stack. Learners practice array-based stack implementation, string tokenizing with strtok, and basic arithmetic parsing in C.

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

stdio.h · stdlib.h · string.h

Project roadmap

  1. 01

    Design the stack data structure

    ~1h

    Implement a fixed-size array-based stack with push, pop, and peek functions for double values.

  2. 02

    Tokenize input expressions

    ~1h

    Use strtok to split an input line into whitespace-separated tokens (numbers and operators).

  3. 03

    Implement the RPN evaluation loop

    ~2h

    For each token, push numbers onto the stack or pop two operands and apply an operator, pushing the result back.

  4. 04

    Add error handling

    ~1.5h

    Detect and report stack underflow, division by zero, and invalid tokens with clear error messages.

  5. 05

    Support interactive and file input modes

    ~1h

    Let the program read expressions from stdin interactively or from a file passed as an argument.

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.hstdlib.hstring.h