|
|
|
|
|
by masklinn
4704 days ago
|
|
That's how it feels, but the syntax for declaring multiple variables breaks it: int* a, b;
is equivalent to int *a;
int b;
not int *a;
int *b;
So while I think it makes sense to think of the pointer nature as part of the type I stopped using it as the risk of writing incorrect code was too great.Though there's also the option of forbidding shorthand declaration. Then you can write int* a;
int* b;
especially if you have a linter letting you add such a syntax rule. |
|