Re:C/C++ Pointer Declaration Syntax – It makes sense
by dkersten on Tuesday February 21, 2012 @05:47AM
(#3616012)
It makes sense, but I still don't like it as its error prone.
It does make sense that the dereferenced pf is a float, but that doesn't stop it from being confusing. Being a pointer is, to me, part of the type. A pointer is a type after all, so having the * bind to the type would make a lot more sense to me.
Additionnaly it makes it easier too lookup for a variable's type when reading
It would also be easier to grep for types too (not that I've ever found myself doing that, but I'm sure people occasionally do)
It does make sense that the dereferenced pf is a float, but that doesn't stop it from being confusing. Being a pointer is, to me, part of the type. A pointer is a type after all, so having the * bind to the type would make a lot more sense to me.
Additionnaly it makes it easier too lookup for a variable's type when reading
It would also be easier to grep for types too (not that I've ever found myself doing that, but I'm sure people occasionally do)