2 ms·
I used to have the exact same confusion until I reread K&R just last month. The idea behind int foo; is that: foo is an int. That is to say: typeOf(foo) == int
by Danieru 14y ago
I used to have the exact same confusion until I reread K&R just last month.
The idea behind int foo; is that: foo is an int. That is to say: typeOf(foo) == int. So you can still think of as the dereferencing operator.
Personally I would prefer int& foo; since pointers are complicated enough already without the indirection.