News for hackers. Stuff that matters.
Re:C-style: My favorite C programming practices by Y_Y on Monday May 20, 2024 @02:55AM (#40412995)
* doesn't (have to) mean "pointer"!

It works in simple cases, but I find the consistent thing to do is read it as "dereference".

    double volatile *(const immutable_pointer); 
    // immutable_pointer is immutable, when you dereference it you'll get a volatile double
Re:C-style: My favorite C programming practices by planede on Monday May 20, 2024 @07:02AM (#40414189)
Yes, that's the philosophy around the declaration syntax.

The declaration of the pointer ip,

  int *ip;
is intended as a mnemonic; it says that the expression *ip is an int. The syntax of the declaration for a variable mimics the syntax of expressions in which the variable might appear. This reasoning applies to function declarations as well.

K&R C