3 ms·
FTA: “In C, the following declares x to be a pointer, but (surprisingly at first!) y to be a normal integer: int* x, y; Whereas the equivalent in Go does wh
by Someone 3y ago
FTA: “In C, the following declares x to be a pointer, but (surprisingly at first!) y to be a normal integer:
int* x, y;
Whereas the equivalent in Go does what you’d expect, declaring both to be pointers:
var x, y *int
”*
I don’t see how that’s an argument in favour of `age int` over `int age`. Both C could easily have picked the alternative semantics. Go could have, too:
var x*, y* int; // two pointers
var x, y* int; // x is an int, y a pointer to int
or
var *x, *y int; // two pointers
var x, *y int; // x is an int, y a pointer to int