Answer the question
In order to leave comments, you need to log in
Console calculator in C++. How to do it better?
There are two notations in C language:
1) int x = 2+3*4;
2) charstr[] = "2+3*4";
In the first case, we will get the value of the expression 2+3*4, and in the second, its string record.
Actually the question is: is it possible to convert a string read from the console into an arithmetic expression using standard language methods?
I understand that you can write a program for this yourself, but it's a long time and a bicycle.
Answer the question
In order to leave comments, you need to log in
Stroustrup - Principles and practice of programming , if I'm not mistaken, then in chapter 6 it seems to be about this. It describes the complete process of creating this calculator, with the prioritization of actions when writing an expression to a string.
Quite standard - no. Some kind of mathematical libraries - maybe. But in fact, this is a good task for a student studying programming.
but it's long and bike
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question