logoalt Hacker News

kazinatortoday at 2:48 AM0 repliesview on HN

In C declaration syntax, there is a "stem" called declaration specifiers consisting of specifiers and qualifiers. That's where int can appear. After that, there is a declarator. In some cases, multiple declarators separated by a comma, which share the same "stem".

  int a, b, *c; // one stem consisting of "int", three declarators.
The * is declarator syntax for deriving a pointer type. It never appears such that a type specifier would come after it somewhere to the right.

Some languages have extended the C declaration syntax such that the type derivators can be moved from the declarator part to the "stem". For instance, as an alternative to:

  int a[10];
you can write

  int[10] a;
This is how we could get

   **int[3]
as a declarator stem indicating an array of 3 pointers to pointers to int. But it's not in C.