B
Bill Cunningham
SG said:Why?
Personally, I prefer to use [] when declaring a function if the
function potentially wants "more than thing" (i.e. does pointer
arithmetic on it to access more than one object etc). I prefer *
otherwise. It makes the code kind of self-documenting to some degree.
One could argue that * and [] is an irregular aspect of the language
and one should avoid it just to make it easier for people to read the
code who don't know the rule that the compiler replaces the top-level
[] in function parameter types with *.
But then again, we still have array-to-pointer decay which is
something newbies have to deal with eventually... So much for
regularity.
Cheers!
SG
I guess to each his/her own.
Bill