You're getting confused between two very distinct topics in C/C++ - Pointers, and function pointers, which are both a rather different kettle of fish.
The reason that function pointers can be handled in such a way as shown in your original post is because of the nature of functions themselves.
in C/C++, you can really only do two things with a function - you may call it, or you may take its address.
Contrast this with a variable, you may also take its address, but you may not call it. In addition to this, unlike functions, you can assign to it, and you can obtain the data it stores.
Since functions and variables are so different, it follows that a pointer-to-function behaves differently to a pointer-to-variable.
Just to put the above into context, when you use the name (identifier) of a function, without the trailing parentheses, the compiler already knows that the function cannot have a value stored, therefore the address of the function is returned instead - the & (address-of) operator is unnecessary.
When you use the name/identifier of a variable, the compiler assumes you wish to obtain its stored value. Hence, if you wish to obtain the address of a variable you must explicitly use the '&' (address-of) operator.
The example you posted using the * (dereference) operator is not legal for the same reasons listed above. this is - a function has no stored data value, so explicitly dereferencing a pointer-to-function does nothing.
On the other hand A variable does store a value, so explicitly de-referencing a pointer-to-variable does have an effect (the effect is to return the variable itself). Ordinary non-pointer variables may not be de-referenced (This would be a nonsensical operation)
the dereference operator (*) on a pointer gives a reference to what is pointed to. the address of operator on a reference gives a pointer to what is being referred to. since a reference to a function can be implicitly treated as a pointer (an implicit address of is assumed),
*f == *(&f) == f
it really has got nothing to do with values or data. a void* points to some data (we do not know what it's type is), but cannot be dereferenced. an int* points to an int, so dereferencing it gives us a reference to an int (int&).
Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.
This thread is more than three months old
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.