3 ms·
Should perhaps be int Foo_bar(const Foo * self);
by kibibu 3y ago
Should perhaps be
int Foo_bar(const Foo * self);
- glitchc 3y agoEven then, some other function can change the memory at the address of self while this one is executing, especially in concurrent systems. Additionally, any other pointer pointing to the same address can also modify self's memory. const in this case is really just "scout's honour".
- jenadine 3y ago`const Foo*` and `Foo const*` are exactly the same and just a question of style (east-const vs. west-const) Not to be confused with `Foo *const`
- PennRobotics 3y agoFor anyone thinking, "wtf const pointer order??" fall back on the spiral rule: https://c-faq.com/decl/spiral.anderson.html https://c-faq.com/decl/spiral.anderson.html