Message from C, C++ talks

June 2019

— 1) Don't use compile time arrays, they will fill your heap space up.
2) don't read a full line at once, because it will make you do the parsing twice
3) You can do the parsing recursively because you know that if there is something after the second operand, you have a second equation.

do something like this:
a + b

if after b, you have another operation, you evaluate
a + (b + c)

for example

that way, you don't even have to store the numbers, meaning that you will be less likely to fuck up and you won't even have to use the std::vecto

Message permanent page

— Oh true, missed that. Well then you could replace those with if/else

— Would be better

— BinaryByter mmihov sry for being intense... Can u help??


>2. You're including headers you don't even need.

Wait, aren't you the guy who thinks that compilers are spotless at optimizing?=

— Ask us what you dont understand, instead of telling us that you don't understand it

— No I'm not and even if they were that doesn't mean you should include every header file you've heard of

Message permanent page

— Yeah i just told that... Its clear from my question/image that how does scanf works in this case...

— Ask EXACTLY what you don't understand

— And it won't increase runtime, but would increase compile time

— It will increase runtime 😉

— And executable size

— What about using namespace std?

— Whoa... the output is coming in these cases...

— Reading...😅