+ 2
[solved] Any C++ evaluation function?
Is there any function in standard library of C++ to evaluate the string as C++ code (like Python and JavaScript's "eval")?
1 Réponse
+ 8
No, by design this is not possible. C++ is a compiled language that is supposed to compile into a binary that can be executed by an operating system. This makes it a lot faster but also means it is less flexible at runtime. In general eval is rarely useful, often seen as bad habit and can be rewritten in more robust code.