Does C++ have a method in which you can run a string of code? For example:
int main() { int i; executeString("i=142"); std::cout << i; system("pause"); }
to print 142 to the screen. This would allow the user to run code from the program.
-J.M
That would make sense. I learned my first programming language on an interpreted system, which included an execute_string function. Thanks.
Build your own expression evaluator such as http://www.arstdesign.com/articles/expression_evaluation.html or Google "embeddable scripting language". C is a compiled language, you are talking about an interpreter.
Log in to post a comment.
Does C++ have a method in which you can run a string of code? For example:
include <stdlib.h>
int main()
{
int i;
executeString("i=142");
std::cout << i;
system("pause");
}
to print 142 to the screen. This would allow the user to run code from the program.
-J.M
That would make sense. I learned my first programming language on an interpreted system, which included an execute_string function. Thanks.
-J.M
Build your own expression evaluator such as http://www.arstdesign.com/articles/expression_evaluation.html or Google "embeddable scripting language". C is a compiled language, you are talking about an interpreter.