Re: [C or C++] Is this legal? sizeof *p
From: Jason (spacenjasset_at_yahoo.co.uk)
Date: 01/04/04
- Next message: Nils O. Selåsdal: "Re: Sizeof question"
- Previous message: Steve: "Re: Question about using code in a program one does not fully understand."
- In reply to: Jack Klein: "Re: [C or C++] Is this legal? sizeof *p"
- Next in thread: Richard Heathfield: "Re: [C or C++] Is this legal? sizeof *p"
- Reply: Richard Heathfield: "Re: [C or C++] Is this legal? sizeof *p"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 4 Jan 2004 12:22:30 -0000
"Jack Klein" <jackklein@spamcop.net> wrote in message
news:2csevvcntm2up8b4vm4e6khlnlbh366tp2@4ax.com...
...
> On Sat, 03 Jan 2004 17:17:30 -0500, Jeff Schwab <jeffplus@comcast.net>
> In C++, and in C except for one special case in C99, the sizeof
> operator is guaranteed not to evaluate its operand, merely use the
> operand to identify the type and hence the size.
...
Thanks, I suspected that be the case. I suppose that this sort of usage is
to be discouraged as a matter of readability. Although it does have the
advantage that if the type changes the sizeof *p need not.
- Next message: Nils O. Selåsdal: "Re: Sizeof question"
- Previous message: Steve: "Re: Question about using code in a program one does not fully understand."
- In reply to: Jack Klein: "Re: [C or C++] Is this legal? sizeof *p"
- Next in thread: Richard Heathfield: "Re: [C or C++] Is this legal? sizeof *p"
- Reply: Richard Heathfield: "Re: [C or C++] Is this legal? sizeof *p"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|