Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matt-y-ice/stack_calculator
https://github.com/matt-y-ice/stack_calculator
Last synced: 15 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/matt-y-ice/stack_calculator
- Owner: Matt-y-Ice
- Created: 2024-07-29T22:01:09.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-07-29T22:02:33.000Z (5 months ago)
- Last Synced: 2024-11-25T01:29:02.698Z (about 1 month ago)
- Language: C
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Stack Calculator
A simple stack-based calculator implemented in C that converts infix expressions to postfix and evaluates them.
## Features
- Converts infix expressions to postfix notation
- Evaluates postfix expressions
- Handles multi-digit numbers and basic arithmetic operators (+, -, *, /)## Usage
### Compilation
Compile the program using `gcc`:
```sh
gcc -o stack_calculator stack_calculator.c
```
### Runing the programTo run the program, pass an infix expression as a command-line argument (note: current version does not handle floats as inputs)
```sh
./stack_calculator "3+5*2"
# Output: 13.000000
```