int myfunc( int a, int b, char * c )
char a = "(int)myfunc()";
char b = "(int,int,char*)"
call(a, b, ...) // Function name and return type, params
I want to do function what registers forward what will get callback if the time is right.
Basically then i dont need to edit and add extra functions into source files.
I just have to include header and use register forward function.
If there is anything close to this it would be perfect!
Thanks!
#include <iostream>
// here, the function print takes a function as the second
// argument and calls it
// how is a pointer to a function taking a std::size_t(unsigned
// argument and returns nothing
void print( std::size_t times, void (*how)(std::size_t) )
{
how( times ); // dereference through '( )'
}
void f( std::size_t N )
{
for( std::size_t i = 0; i < N; ++i ) {
std::cout << "Hello World\n";
}
}
void g( std::size_t N )
{
for( std::size_t i = 0; i < N; ++i ) {
std::cout << "Hello ";
}
}
int main()
{
print( 3, &f ); // '&' (address of) is optional
print( 3, g );
}
Hello World
Hello World
Hello World
Hello Hello Hello
More advance code involve templates or std::function but i'm going to bed now, maybe someone else could explain what is more appropriate for your problem
( link says : Error 404: This page could not be found. )
Anyway, is there possible to name function name with the function.
So basically if i read name from .txt i can call that function somehow?