"Dario (drinking co?ee in the o?ce?)" wrote:
> Here my religious answer...............
>
>
> Typically in my code I write:
>
> int * abc;
> char de;
> my_type fgh;
> int ijkl;
> int * mn;
> my_long_type opq;
> my_type * rstu;
> my_long_type * vw;
> my_long_type xyz;
>
> My rules (used in the last 20 years):
>
> type variable_name1; /* Only 1 variable per declaration */
> type * variable_name2; /* Note the space between type and * */
> very_long_type variable_name3; /* All variable-name aligned */
>
Well, that makes sense, because, after all, abc is a data item whose type
is pointer. *abc refers to its contents. So, strictly, int *abc doesn't mean
anything. Or shouldn't. Well, it was that way 20 years ago, please correct
me if I'm wrong - I haven't read the actual Spec yet. Is this Spec available
on the net somewhere, or do I need to piece it together from tutorials and
NG stuff? Buying a book isn't in the budget this week, for the same reason
that all my time is free for learning stuff.
But this is a C++ group - are pointers really that rampant? I'd have thought
a reference would be more in the spirit of OOps? But I'm a C++ noob, and
learned to cut-n-paste C by guess & by gosh, with K&R at my side.
Thanks,
Rich