cdecl

Computing 2009.04.10 18:17

Ever had a hard time deciphering a wierdly written C declaration? Did you end up scratching your head, saying "Who on earth would write codes like these?!"

Here's a wonderful solution to it : cdecl.

Cut to the chase. Get a brief look at how it works :

$ cdecl
Type `help' or `?' for help
cdecl> explain int (((*a)[3][4]))
declare a as pointer to array 3 of array 4 of int
cdecl> explain int (((*a)[3][4])(void))
declare a as pointer to array 3 of array 4 of function (void) returning int
cdecl> declare a as pointer to array 4 of pointer to function (int) returning void
void (*(*a)[4])(int )
cdecl>

Oh, my god! It's exactly what I was looking for!


tags :
Trackback 0 : Comment 0

Write a comment

티스토리 툴바