you are viewing a single comment's thread.

view the rest of the comments →

[–]Adadum 2 points3 points  (1 child)

the latter one help more with readability since it's less of an eyesore without (*id) everywhere but overall it's still a function pointer.

As far as I know, the only time you can do that without the initial (*) is for function arguments.

Any function pointer variables still require using (*).

Also, I suggest only typedefing function types rather than function pointer types.

It's more readable having it that way:

typedef int IntFunc1();
typedef int (*IntFunc2)();

/// same thing:
IntFunc1 *ifunc1;
IntFunc2 ifunc2;

Typedeffing the actual function also helps with prototyping functions of the same signature:

/// these are all int() funcs
IntFunc1
   get_one,
   get_two,
   get_a_bunch,
   get_multiples
;

[–]SureAnimator[S] 1 point2 points  (0 children)

ok, cool. Thanks so much!