Re: Pointers
From: CBFalconer (cbfalconer_at_yahoo.com)
Date: 03/11/05
- Next message: CBFalconer: "Re: Getting the xth bit of an unsigned charcter"
- Previous message: Mark McIntyre: "Re: malloc? I am lost again"
- In reply to: Thomas Stegen: "Re: Pointers"
- Next in thread: Keith Thompson: "Re: Pointers"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 11 Mar 2005 15:52:16 GMT
Thomas Stegen wrote:
>
... snip ...
>
> One way to see the declaration syntax (losely as it is) is that you
> declare expression that evaluate to a certain type, char above.
>
> So you say *c evaluates to char. Sort of. I think it would be better
> to say:
>
> pointer_to_char_type a,b,c;
>
> Now all the above is of type char* (as it is now). The above can be
> achieved using a typedef of course, but we don't like hiding
> pointers in typedefs, do we?
I think that is an irrational attitude. We hide pointers all the
time with such things as:
char *thingummy;
If we want to emphasise the pointerness we can write:
char *thingptr;
and there is no reason not to do the same things, for the same
reasons, with types by:
typedef char *thingamabob;
or
typedef char *athingptr;
except that now there is no confusion with multiple definition in:
athingptr a, b, c;
all of which are of type athingptr (or thingamabob if desired). It
is all part of decoupling code modules.
-- Chuck F (cbfalconer@yahoo.com) (cbfalconer@worldnet.att.net) Available for consulting/temporary embedded and systems. <http://cbfalconer.home.att.net> USE worldnet address!
- Next message: CBFalconer: "Re: Getting the xth bit of an unsigned charcter"
- Previous message: Mark McIntyre: "Re: malloc? I am lost again"
- In reply to: Thomas Stegen: "Re: Pointers"
- Next in thread: Keith Thompson: "Re: Pointers"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|