Hi all, i have a certain certain command code that seems ambigues to me and I'm forced to use it. Can anyone explain the meaning of this particular line of code: ???
Code:
typedef void (*Function_Type)(ItemType &item);
i'm having problem with comprehending the use "typedef" along with the entire function pointer...
my first inclination was that this is a pointer to a function which returns void and takes (ItemType &item) as an argument...??
and just for reference, I have a function that takes that same function pointer as an argument and inside calls another function whose (obviously) pointer to was passed in: for example
Code:
void traverse(Function_Type visit)
{
for(int i = 0; i < size; i++)
{
visit(array[i]);
}
}
now, with all this said, i was trying to call the function "traverse()" but i'm always getting compiler errors, even when i try to use different way of expressing parameters i.e:
Code:
// function call
traverse(display(ItemType &item));
something like that, but i can't get it to work,
can anyone help???
I hope I made my question clear enough??? if not let me know???
Thanks....
matheo917