can we calling defined function based on passing variable in C++ like on PHP?
for example, in PHP we can calling function like:
Load_$Input();
CMIIW.
can we calling defined function based on passing variable in C++ like on PHP?
for example, in PHP we can calling function like:
Load_$Input();
CMIIW.
No, C++ does not support variable functions. However, as long as you can map strings to function pointers (or function objects), you can do something similiar.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
is there any tutorial about that? sorry i'm newbie in C++.
Tutorial on std::map and std::unordered_map, or tutorial on function pointers and function objects?
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)