Void (*(*f[])())();

void (*(*f[])())();

Other urls found in this thread:

c-faq.com/decl/spiral.anderson.html
twitter.com/NSFWRedditImage

ok

what language?

looks like C. Appears to be a void function that casts a pointer to a pointer to a char array function that takes no parameters. correct me if im wrong.

saged

(()=>{(()=>{})()})();

>correct me if im wrong.
It's a function pointer to a function that returns an array of void functions.

>an array of void functions
and why would anyone need to do that again?

typedef uint32_t (Wtf::*WtfFunctionPtr)(char* c, uint32_t i);

Table of interrupt vectors, for example.

import do_stuff

do_stuff.do_stuff()


life's good

c-faq.com/decl/spiral.anderson.html

(*(*f[i])())(); // this returns void
Perfectly readable. An array of pointers to functions that take no/unspecified arguments and return pointers to functions that take no/unspecified arguments and return void.

(_)_)llllllllllllllllllD

lpbp

>c-faq.com/decl/spiral.anderson.html
>It's a sort of a... middle-out algorithm!

Sup Forumsangsters will become massively butthurt for me saying this but Java was designed sensibly when it came to pointers. Java in some ways is based because it prevents programmers from making the mistakes that programmers typically make. From not implementing goto functionality to making garbage collection automatic and putting pointers behind the scenes, Java is clearly a better designed language.

not using trailing return types is one of C's biggest mistakes
>a function pointer to a function that returns an array of void functions
Literal translation in a more sane language:
() => () => Seq[() => ()]

or if we're still using void instead of the FP wanker thunk/Unit crap (and ptr/array as similarly un-retarded syntax for pointers/arrays):
yourPtr: ptr[void -> array[void -> void]] = ...

bam! humanly readable, not difficult to parse either. It's like that time FORTRAN unfucked itself after a few decades of suffering from every possible lang design mistake
At least c++11 added trailing ret types

This. Trailing return types look super ugly at first but they do in fact grow on you.

pros and cons to everything

>yourPtr: ptr[void -> array[void -> void]] = ...
and if we avoid the A -> B shorthand, to make it even more explicit (will be more readable for some, less for others)
yourPtr: Ptr[ Func[ void, Array[ Func[void,void] ]]] = ...

bit of a mess on the closing brackets tho. Gotta aim for dat goldilocks optimum

and if we take the C# route and define Action[B] === Function[void, B]:
Ptr[Action[Array[Action]]]

any language's syntax can look shitty if you mangle it like a fucking retard and look for outlying cases that will never be used in the real world.