[C + +] Let's say I have a string a="+32+4-6", how do I evaluate it equal to 30 and store it in an integer variable? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

[C + +] Let's say I have a string a="+32+4-6", how do I evaluate it equal to 30 and store it in an integer variable?

19th Oct 2018, 4:00 AM
Infinity
Infinity - avatar
7 Answers
19th Oct 2018, 6:15 AM
Saurabh Tiwari
Saurabh Tiwari - avatar
+ 5
19th Oct 2018, 6:56 AM
Infinity
Infinity - avatar
+ 2
write this code int a; a = 32+4-6; cout << a;
28th Oct 2018, 9:57 AM
BlazeGamingUnltd
BlazeGamingUnltd - avatar
+ 2
BlazeGamingUnltd The user will enter 32+4-6 as a string! (actually its a part of a problem, I understand it looks odd)
28th Oct 2018, 10:06 AM
Infinity
Infinity - avatar
+ 2
oh..
28th Oct 2018, 10:07 AM
BlazeGamingUnltd
BlazeGamingUnltd - avatar
+ 1
I also don't know
4th Nov 2018, 8:35 AM
Ssebudde Abbey
Ssebudde Abbey - avatar
0
i dnt understand pls elp i wnt to code apps wt lesson shuld i go 4r is it c++ or java pls explain
21st Oct 2018, 1:43 PM
Tee Jay Max
Tee Jay Max - avatar