3 ms·
I'm no C expert, but couldn't you contain the madness for a good part with a sane code convention and smart use of typedefs? It looks to me as if the part where
by xg15 12y ago
I'm no C expert, but couldn't you contain the madness for a good part with a sane code convention and smart use of typedefs? It looks to me as if the part where everything breaks down is mostly with "nested" function pointer types like in the "ultimate" example of the tutorial.
(The syntax of "simple" function pointers is quirky as well, but without recursion, you might get the hang of it after a short time)
So, couldn't you avoid much of the confusion by mandating that function pointers may refer to other function pointers only through typedefs?
Of course this wouldn't work for legacy code...
- outworlder 12y agoYes, that makes it slightly saner by not having to parse the declaration in your head all the time.