surrealandlost
Programmer
Is it at all possible in a standard console program to pass a function as a parameter?
Example:
int test( int x, int y ) {
return (x + y);
}
int foo( int z, function blah ) {
return blah( z, 1 )
}
int main() {
cout << foo( 1, test ) << endl;
// will print 2
return 0;
}
Example:
int test( int x, int y ) {
return (x + y);
}
int foo( int z, function blah ) {
return blah( z, 1 )
}
int main() {
cout << foo( 1, test ) << endl;
// will print 2
return 0;
}