Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 7
C++ is compiled language so there's no runtime ``` eval() ``` ( You will have to use an external library or just compile and run a temporarry piece during runtime which must satisfy a prerequisite of having a compiler on target machine ) some expressions evaluator : https://archive.codeplex.com/?p=fastmathparser#:~:text=The%20C%2B%2B%20Mathematical%20Expression%20Toolkit,and%20is%20very%20easily%20extendible. http://www2.lawrence.edu/fast/GREGGJ/CMSC270/parser/parser.html https://github.com/cparse/cparse
31st Aug 2021, 8:33 AM
Prashanth Kumar
Prashanth Kumar - avatar
+ 5
https://www.researchgate.net/post/Is_there_any_source_code_in_C_C_to_evaluate_strings_like_eval_in_Matlab_javascript_and_Python https://www.quora.com/What-is-a-method-in-C++-to-evaluate-strings-like-eval-in-JUMP_LINK__&&__Python__&&__JUMP_LINK These links will surely give you the answer.
31st Aug 2021, 8:08 AM
HK Lite
HK Lite - avatar
+ 1
eval() is just a function. you can create that function yourself in C++, although normal operations do a better job
1st Sep 2021, 9:24 AM
Rellot's screwdriver
Rellot's screwdriver - avatar
+ 1
l4t3nc1 never mind he is spamming and lets delete the comments thats irrelevant to this thread (his may be deleted by mods team) this helps in maintaining our forum clean. please.. (i will delete this after u see it)
1st Sep 2021, 10:57 AM
Prashanth Kumar
Prashanth Kumar - avatar
0
Lazy c++ programmer... 🤣
1st Sep 2021, 5:02 PM
Bernard Bordja
- 2
ChillPill Are we harvesting uranium 235 through this one?
1st Sep 2021, 3:42 PM
l4t3nc1
l4t3nc1 - avatar
- 16
What means float?
31st Aug 2021, 4:39 AM
Divyanshu Kumar