A bit tedious to explain, but I will try. I have a function, which takes an address as input. Then instead of saving the variable first, so I can pass the address to that variable on to the function, I would like to enter the function directly as a parameter. Is there a way to do that?
Something like this:
#include <iostream>
#include "main.h"
using namespace std;
int main()
{
printFunction(returnOne());
return 0;
}
void printFunction(int *a) {
cout << a << endl;
}
int returnOne() {
return 1;
}