4 ms·
This is a great helper for getting acquainted with the C spiral rule: http://c-faq.com/decl/spiral.anderson.html http://c-faq.com/decl/spiral.anderson.html
by jankins 13y ago
This is a great helper for getting acquainted with the C spiral rule: http://c-faq.com/decl/spiral.anderson.html http://c-faq.com/decl/spiral.anderson.html
- NAFV_P 13y agoThank you very much for the website.
- michaelcampbell 13y agoInterestingly, the "ultimate" example in that page fails to parse with the web cdecl.
- stephencanon 13y agoI've said it before (http://news.ycombinator.com/item?id=5080096 http://news.ycombinator.com/item?id=5080096), I'll say it again: the "spiral rule" makes pretty pictures, but it's nonsense.
- praptak 13y agoSomehow I cannot find those "spatial" (for lack of better name) rules useful. What works for me is "type declaration mimics usage". So I find the variable name, parse the declaration as usage and then reconstruct the type. It goes like this: char *((*foo)[3])(int); Ok, so if you dereference foo, then index[3], then call with int, then dereference, you get char? Cool, looks like foo is a pointer to an array of size 3 of functions that take int and return pointer to char.