Message from C, C++ talks

June 2019

β€” How are you

β€” How this works??

β€” Cool...n u??

β€” πŸ˜

β€” 

1. Don't use the C header files (ending in .h ) in C++. Use the C++ version of those.
2. You're including headers you don't even need.
3. Lines 23 and 24 are exactly why do while exists.
4. using namespace std;
5. Line 39, 40 and 64 are why for exists.
6. Why are you passing NULL to strtok on line 37?
7. The if's could be replaced with a switch

β€” Thanks... I have some knowledge...but this blew off my fuse

β€” TinkuBanna can u look into it

β€” Yes but I don't know

β€” Ok

β€” I thought switch can only take char and int wasn't knowing that it can take stringsπŸ˜…
and
passing null to terminate while loop πŸ™„
thanks for giving your time will try to improve 😁

Message permanent page

β€” 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?=

Message permanent page