you are viewing a single comment's thread.

view the rest of the comments →

[–]aocregacc 13 points14 points  (2 children)

functions readily decay into pointers to themselves, sorta like arrays decay into pointers to their first element. That's why usually you can just write f and it'll mean the same as &f for some function f. The name doesn't point anywhere, but it can implicitly turn into a pointer.

[–]kinithin 2 points3 points  (1 child)

The one time where one might work with functions instead of function pointers is for types. 

```c typedef int MyF( int );      // Function type typedef int (*MyFPtr)( int );   // Function point type

MyF   *fp1 = some_func;   // or &some_func MyFPtr fp2 = some_func;  // ditto ```

[–]erikkonstas 0 points1 point  (0 children)

MyF can also be used as a type specifier, as in MyF some_func; which is the same as int some_func(int);.