|
|
|
|
|
by watergatorman
2720 days ago
|
|
By 2 styles of pointers used in functions, see below taken from your examples. By reading both left-to-right and right-to-left I mean:
"star" pointer in front of the identifier read right-to-left with return function type on the left
and ampersand pointer read left-to-right with return function type on the right of "->" Here are 2 of your function examples you gave: This example has both an outermost "void" function return type on the left and another to the right of "->"
"void (* f)(g &(int) -> void)"
Instead use the following to always read left-to-right and get rid of the "star" pointer:
"f &(g &(int) -> void) -> void" Your next example has 2 "void" function return types on the left, and one "void" to the right of "->"
"void (* f)(g &(void (* h)(x &int)) -> void)"
Instead use the following to always read left-to-right:
"f &(g &(h &(x &int) -> void) -> void) -> void" |
|