I have noticed that there are two methods to invoke a function pointer in C++.
Example code:
void A(int x){
...
...
}
main() {
void (*f)(int);
f=&A;
f(); //Method 1
(*f)(); //Method 2
}
Why do both Method 1 and 2 work? And what is the logic for both methods having the same behaviour?