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
+ 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.
+ 1
eval() is just a function. you can create that function yourself in C++, although normal operations do a better job
+ 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)
0
Lazy c++ programmer... 🤣
- 2
ChillPill
Are we harvesting uranium 235 through this one?
- 16
What means float?