Re: why use -> (not .) with pointers?
- From: Clark S. Cox III <clarkcox3@xxxxxxxxx>
- Date: Thu, 30 Jun 2005 14:36:19 -0400
On 2005-06-30 13:56:20 -0400, roberson@xxxxxxxxxxxxxxxxxx (Walter Roberson) said:
In article <42c428a3$0$304$7a628cd7@xxxxxxxxxxxxxxxxxxxxx>, Guillaume <"grsNOSPAM at NOTTHATmail dot com"> wrote:When I see so many programmers mixing integers and fp numbers in expressions without quite knowing what they are doing (and sometimes wondering why the heck they don't get the results they are expecting), I'm thinking: why not different operators. At least, that would force you to have a clear understanding of both what you want and what is going to happen, without having to read dozens of pages of the standard and praying that your compiler sticks to it...
An alternative would be to not do silent type conversion in expressions -- except perhaps (for convenience) for some forms involving constants.
If there is no operator for int + float then the programmer would have to put in explicit type casts as necessary, thus forcing the programmer to pay attention at each substep to the types.
Such a scheme might do interesting things to expressions such as toupper(HexChar) - 'A' + 10 due to the signed-ness ambiguity of char...
Except that there are no char's in that expression, only three int's. ;)
-- Clark S. Cox, III clarkcox3@xxxxxxxxx
.
- References:
- Re: why use -> (not .) with pointers?
- From: Walter Roberson
- Re: why use -> (not .) with pointers?
- Prev by Date: Re: how to let gcc warn me when I use = in conditions
- Next by Date: Re: why use -> (not .) with pointers?
- Previous by thread: Re: why use -> (not .) with pointers?
- Next by thread: Re: why use -> (not .) with pointers?
- Index(es):