S
Steven T. Hatton
I'm reading through Kyle Loudon's _C++_Pocket_Reference_ for the sake of
review. He uses the notational form used by Kernighan and Ritchie in
declaring pointers (and by extension references). That is, the '*' or '&'
is placed directly preceeding the identifier being declared. Stroustrup
consistently uses the alternative form of placing the '*' or '&'
immediately after the type name of the object to be pointed to or
referenced.
I much prefer Stroustrup's style because it seems to be grammatically more
accurate, and does not give the impression that the '*' or '&' is being
used as an operator in the declaration.
I have seen a third approach of putting whitespace on either side of the '*'
or '&'. To me this is simply equivocating non-committal.
So I have two questions about this. First which do you prefer and why?
Second, what is the formal grammatical decomposition of a declaration of
the form:
int* i; ?
Yes, I am asking this as both a serious question, and tongue-in-cheek.
I'm just curious what others have to say about it. What style do other
notable authorities use?
review. He uses the notational form used by Kernighan and Ritchie in
declaring pointers (and by extension references). That is, the '*' or '&'
is placed directly preceeding the identifier being declared. Stroustrup
consistently uses the alternative form of placing the '*' or '&'
immediately after the type name of the object to be pointed to or
referenced.
I much prefer Stroustrup's style because it seems to be grammatically more
accurate, and does not give the impression that the '*' or '&' is being
used as an operator in the declaration.
I have seen a third approach of putting whitespace on either side of the '*'
or '&'. To me this is simply equivocating non-committal.
So I have two questions about this. First which do you prefer and why?
Second, what is the formal grammatical decomposition of a declaration of
the form:
int* i; ?
Yes, I am asking this as both a serious question, and tongue-in-cheek.
I'm just curious what others have to say about it. What style do other
notable authorities use?