Hacker News new | ask | show | jobs
by MaxBarraclough 2106 days ago
It's a pretty bad syntax.

A demonstration of a declaration statement where the asterisk operator binds to an identifier rather than to a type:

    int my_int, *my_ptr, my_other_int;
A demonstration of a different declaration where the asterisk operator does not bind to an identifier, as an identifier isn't even needed:

    extern void my_function(int*, char*);
So the real answer is that it depends on what you're doing. Terribly clunky.

Interestingly the D programming language mostly keeps C's syntax, but handles multiple declarations differently. https://dlang.org/spec/declaration.html#declaration_syntax