C/C++ guru's -- is this possible
-
Hi all, is it possible in c/c++ to call a function that is created from variables. .. ex/ CString myFunction myFunction = "SomeFunction()"; i would like to call the contents of myFunction. don't know if its possible, any insight appreciated Brain
-
Hi all, is it possible in c/c++ to call a function that is created from variables. .. ex/ CString myFunction myFunction = "SomeFunction()"; i would like to call the contents of myFunction. don't know if its possible, any insight appreciated Brain
Possible? Sort of kind of - check out Pete Becker's reply to a similar question at: http://www.cuj.com/archive/1609/qa.html ================== The original message was: Hi all,
is it possible in c/c++ to call a function that is created from variables. ..
ex/
CString myFunctionmyFunction = "SomeFunction()";
i would like to call the contents of myFunction.
don't know if its possible, any insight appreciatedBrain
-
Hi all, is it possible in c/c++ to call a function that is created from variables. .. ex/ CString myFunction myFunction = "SomeFunction()"; i would like to call the contents of myFunction. don't know if its possible, any insight appreciated Brain
================== The original message was: Hi all,
is it possible in c/c++ to call a function that is created from variables. ..
ex/
CString myFunctionmyFunction = "SomeFunction()";
i would like to call the contents of myFunction.
don't know if its possible, any insight appreciatedBrain
Brian: Yes, this is possible. The function GetGreater will get the greater of the two values passed in... int GetGreater ( int, int ) ; typedef int (*GetGreater) (int, int) ; // this declares a ptr to this function. Then in the code... { PGetGreater pgg; int maxvalue; pgg = GetGreater; if ( pgg ) { maxvalue = pgg ( 5, 3 ) ; } } Or something like that :-) Peter.