/infix-to-postfix

A simple infix to postfix expressions conversion program, written in C

Primary LanguageC

Infix to postfix expression converter

This program converts between an infix expression to the equivalent postfix expression
(also called reverse polish notation or RPN). This is useful especially because it's easier to
evaluate with a program (such as the one I wrote).

compile using gcc *.c -o execname
To run it, just type ./execname "expr", where expr MUST be quoted, so that it's passed as argv[1]

  • Expressions can be written in the usual form, such as "1*3-(7+4/4)"
  • Unary operators are not supported yet, so "-(-10)" would produce wrong RPN expressions
  • Supported operations are the following: +, -, *, /, %, ^(note on exp)

Note:The operator actually has left to right associativity, but parentheses can force certain patterns if needed