3 ms·
Pointers 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 t
by bluetomcat 2y ago
Pointers 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.