Question about cast
- From: spibou@xxxxxxxxx
- Date: 3 Aug 2006 11:12:43 -0700
In page 81 of N1124 in footnote 87 we read:
If the value of the expression is represented
with greater precision or range than required
by the type named by the cast (6.3.1.8), then
the cast specifies a conversion even if the type
of the expression is the same as the named type.
Can someone give me an example of what this means ?
Otherwise the relevant section hardly says anything about
the semantics of cast. Assume for example that on some
machine unsigned int is 32 bits and unsigned char is 8
bits. If i is unsigned int what is the value of
(unsigned char) i ? Is it the same as 255 & i but of type
unsigned char as opposed to unsigned int ?
Spiros Bousbouras
.
- Follow-Ups:
- Re: Question about cast
- From: spibou
- Re: Question about cast
- From: Ben Pfaff
- Re: Question about cast
- From: Tom St Denis
- Re: Question about cast
- Prev by Date: Re: Some problem with C Code
- Next by Date: Re: Some problem with C Code
- Previous by thread: Question about integer promotions
- Next by thread: Re: Question about cast
- Index(es):
Relevant Pages
|
|