Not sure if the title is worded correctly, or if there is a better way of saying it, but I think its okay.
At any rate, I understand the following thus far:
a.b(a, b, c, foo);
Where foo is a function defined elsewhere that takes in no arguments would simply result in the function a.b() running, with the above parameters. The parameter foo can then be called inside function a.b() as simply foo(). In other words, I understand the above call to be using a function pointer as an argument in the function a.b as a parameter.
Okay, now here is what I'm trying to do...
I want to be able to do something similar to the above, except this time I want foo to have a paramater passed in that argument as follows:
a.b(a, b, c, foo(bar));
Now here is the problem. This will literally result in the paramaters a, b, c and the result of foo(bar) being used. I don't want this. I want foo(bar) to literally be passed in so that in the function a.b which would look like this (as the header):
a.b(first, second, third, fourth);
Could reference and call the fourth parameter as:
fourth();
Even if fourth has an argument in it. I can't seem to find a way around this problem, any advice?
Thanks!