Wow, imagine if it was possible to actually use a language like that do declare the type of the variable like that? Something like
str: array [0..9] of ^Char;
or even var str [10]*uint8
Just imagine...It is explained in more detail at this link: https://eigenstate.org/notes/c-decl
str is a duck.
Or
apt install cdecl
on Linux.
stephencanon•39m ago
The correct rule is "follow the C grammar". An easier to remember and also correct rule is "start at the identifier being declared; work outwards from that point, reading right until you hit a closing parenthesis, then left until you hit the corresponding open parenthesis, then resume reading right..." (this is sometimes called the "right-left rule": https://cseweb.ucsd.edu/~gbournou/CSE131/rt_lt.rule.html).
mananaysiempre•25m ago
jcranmer•25m ago
Want to write an array of function pointers that return a pointer to an array of pointers to int? Well, that's:
It doesn't make it all that easy to read, but you can at least write the complex types pretty reliably.(The real answer is of course to just typedef every function pointer type or pointer-to-array and not worry about it anymore.)