I have been programming long enough to know what is correct....but
Code:
typedef int (*pfunc)(void);
int some_func(int arg, pfunc func) {
int i = (*func)(); //correct
...
}
But here is where I am unclear:
Code:
typedef int (*pfunc)(void);
int some_func(int arg, pfunc func) {
int i = func(); //incorrect but works
...
}
The second example does work. As a typical programmer who tends to cut corners from time to time I would like to know if there is any disadvantage to not dereferrencing a call to a pointer to a function?