logoalt Hacker News

coherentponytoday at 1:49 AM1 replyview on HN

I don’t understand what the visualisation screenshot in the README is trying to communicate to me.


Replies

bluetomcattoday at 2:32 AM

It starts from the identifier. At every stage, it outputs a sub-expression which is the “mirrored use” and corresponds to the boxed representation below it. When it reaches the top of the expression, it prints the final type of the expression which is the lone specifier-qualifier list.

As per the screenshot, “arr” is an array of 4 elements. Consequently, “arr[0]” is an array of 8 elements. Then, “arr[0][0]” is a pointer. And so on, until we arrive at the specifier-qualifier list.

show 1 reply