1
1
12345 123452015-08-15 12:45:04
C++ / C#
12345 12345, 2015-08-15 12:45:04

An easy way to parse an expression?

Tell me the easiest way to parse expressions in C. Expressions like 26+35/16+81*67-12. There are no brackets, spaces, etc. An array of characters is passed to the function, you need to get double at the output.

double calculate( char str[] )
{
      //Суть вопроса
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Armenian Radio, 2015-08-15
@damewigit

Explore:

  • Marshalling yard algorithm
  • Reverse Polish notation
  • Calling a translator/compiler from your program

D
Dmitry, 2015-08-15
@EvilsInterrupt

Type in Google "Algorithm shunting yard". Floor calculator of the 2nd year of study at the university;)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question