3 ms·
C would be exactly the same way, if functions didn't implicitly take their own address, so that the & operator had to be used: var(); // okay func(va
by kazinator 10y ago
C would be exactly the same way, if functions didn't implicitly take their own address, so that the & operator had to be used:
var(); // okay
func(var); // okay
var(func); // nope: &func required
func2(func); // ditto
C++ is like this with respect to member functions, which require the & operator to be used:
foo(myclass::staticfun); // error
foo(&myclass::staticfun); // good
(As it is, even calls in C work via a function pointer being involved. In foo(arg), foo is a primary expression denoting a function (if that is how foo is declared in this scope). This primary expression produces a pointer-to-function. The (arg) postfix operator then applies to the pointer.)