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.
This is a discussion on Calling function based on passing variable....... within the C++ Programming forums, part of the General Programming Boards category; can we calling defined function based on passing variable in C++ like on PHP? for example, in PHP we can ...
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.
C + C++ Compiler: MinGW port of GCC
Version Control System: Bazaar
Look up a C++ Reference and learn How To Ask Questions The Smart Way
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?
C + C++ Compiler: MinGW port of GCC
Version Control System: Bazaar
Look up a C++ Reference and learn How To Ask Questions The Smart Way