Hacker News new | past | comments | ask | show | jobs | submit login

The actual rule is "declaration follows use".

int p[5] means the type of p[5] is int (but you still have to remember valid elements are 0-4).

void (signal(void()(int))(int) means the type of (signal(something that is a void()(int))(42) is void. And void(p)(int) means the type of (p)(42) is void.

If you can remember the precedence of these operators, you automatically remember the precedence of their "type operators" as well.




yeah, this is so simple, i don't understand why people keep invent more complex and worse rules to understand cdecl...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: