3 ms·
Still unclear at things like “returning pointer to array of pointer to function …”. The best shot is to name intermediate types, since they aren’t really inter
by wruza 2y ago
Still unclear at things like “returning pointer to array of pointer to function …”.
The best shot is to name intermediate types, since they aren’t really intermediate most of the times. Properly structured programs tend to disassemble complex structures to work on them, so you need these names anyway.
That said, C compilers definitely lack -Wunreadable-types flag which must be default.
- ape4 2y agoI was about to say the same thing. If you have an array of widgets used in several places in your program it would be odd not give it a name. Then you can have a pointer to it, etc.
- bluetomcat 2y agoPointers to arrays are an incredibly rare thing in real-world C programming, let alone functions returning them. They contain the same address as a pointer to the beginning of that array, with the only difference that pointer arithmetic will be done in sizeof(arr) steps, not in element-size steps. It is a widely accepted practice to typedef pointers to functions. With pointers, more than 2 levels of indirection is an indication of a badly written program. In practice, the most complex declarations you should write are "pointer to pointer to x", "array of pointers to x", "array of function pointers returning x". Stuff like "pointer to function returning pointer to pointer to array" is nonsensical most of the time.
- DrNosferatu 2y agoRare? Unless it’s people obfuscating the codebase so they are able to keep their job forever without delivering any new/real value.