A simple stack-based calculator implemented in C that converts infix expressions to postfix and evaluates them.
- Converts infix expressions to postfix notation
- Evaluates postfix expressions
- Handles multi-digit numbers and basic arithmetic operators (+, -, *, /)
Compile the program using gcc
:
gcc -o stack_calculator stack_calculator.c
To run the program, pass an infix expression as a command-line argument (note: current version does not handle floats as inputs)
./stack_calculator "3+5*2"
# Output: 13.000000