Newsgroups: comp.lang.c Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: casts and assignments Message-ID: <1989Dec5.173850.28323@utzoo.uucp> Organization: U of Toronto Zoology References: <6589@arcturus> <21033@mimsy.umd.edu> <3979@vax1.tcd.ie> Date: Tue, 5 Dec 89 17:38:50 GMT In article <3979@vax1.tcd.ie> mbrennan@vax1.tcd.ie writes: >>>... I am led to believe that all assignments include an implicit cast >>>such that: >>> a = (type of 'a') (expression); >>>Is exactly equivalent in ALL cases to: >>> a = (expression); >>>Is this true? > >int i ; >int j ; >long l ; > > l = i * j ; > l = (long) i * j ; > >I realise I may be answering a slightly different question than you posed... You are answering a *completely* different question. Notice that he put parentheses around the expression, which eliminates the problem you mention (`(long)i * j' means `((long)i) * j' not `(long)(i * j)'). -- Mars can wait: we've barely | Henry Spencer at U of Toronto Zoology started exploring the Moon. | uunet!attcan!utzoo!henry henry@zoo.toronto.edu