ccalc is a command-line calculator written in C, created as a small exercise to understand the use of function pointers and modularity in C.
ccalc provides a quick and lightweight way to perform basic arithmetic operations directly in the terminal. It is useful for testing simple calculations without relying on heavy GUIs.
git clone https://github.com/geovannewashington/ccalc
cd ccalc
make
./bin/ccalcOptions:
--no-banner: disables the ASCII banner
Currently, the calculator only supports 4 basic operations (addition, subtraction, multiplication, division) and works with two operands (lhs and rhs).
Compile from source:
git clone https://github.com/geovannewashington/ccalc.git
cd ccalc
make
sudo make install # optional: installs the binaryOr download precompiled binaries from the Release page
⚠️ Currently, the project has only been tested on Linux.
- Demonstrates modularity in C
- Allows easy addition of new operations (pull requests welcome!)
- Introduces function pointers and command-line argument parsing
- Implements error handling and input validation
- Uses ANSI colors for a better terminal experience
- C (C11) – pointers, functions, and memory management
- Modular programming – separate header and implementation files
- Makefile – automates compilation and binary generation
- Command-line argument parsing – flexible usage
- ANSI colors – improved terminal output
- Error handling – program robustness
