0

How can i call functions

how we call functions by string for example int main() { int z; string a="z=pow(2,4);"; exe(a); } exe,ran every thing existing in atring a

13th Jan 2017, 2:34 PM
Ali Kavari
1 Antwort
+ 2
This isn't possible in the way you're thinking. Unlike interpreted languages like Python and JavaScript, compiled languages cannot run arbitrary code. You can create a map of function names to function pointers instead.
13th Jan 2017, 2:56 PM
James Durand
James Durand - avatar