julienp17 / EvalExpr

Evaluate an arithmetic expression

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

EvalExpr

Evaluate an arithmetic expression with priorities and parentheses

Shunting yard algorithm, reverse polish notation...

4 days, 2 students, made with Mathias Atchapa

Description

The eval_expr function had to be prototyped as follows :

int eval_expr(char const *str);

Given mandatory main :

Mandatory main

The program expects that there is no syntax errors in the expression.

Usage :

./eval_expr EXPRESSION

Example

Example

Grade

GRADE

The program crashed when a minus sign was put between two parentheses. It has been rectified in this repository. Our solution was to replace all minus sign by '-1*'.

About

Evaluate an arithmetic expression


Languages

Language:C 90.1%Language:Makefile 6.7%Language:C++ 3.2%