DelphiFAQ Home Search:

Equivalent in C++ to JavaScripts "eval()" function?


commentsThis article has not been rated yet. After reading, feel free to leave comments and rate it.


Is there an equivalent in C++ to the "eval()" function that is found in Javascript?


JavaScript is an interpreted language which makes it easy to provide a formula interpreter as a standard function. C++ is compiled and adding an "eval()" like function would mean major overhead. Therefore such a function is missing in C++ standard libraries.

Content-type: text/html


2006-04-20, 12:16:19
anonymous from United States  
Such an ignorant answer. Yeah try looking up some data structures, or maybe a lexical analysis class with c++ restricting your search to Universities with google. I seem to remember seeing some ideas that would be equivalent or close to equivalent.
2006-04-20, 15:54:40
[hidden] from United States  
Anonymous, what's your point? It is possible to implement eval() in a compiled language - the original answer does not deny that.
But it would be a 'major overhead', while in Javascript, it's part of the interpreter.
2007-04-10, 09:45:44
anonymous from United States  
so hoow do u make such a function?



NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: