Yacine wrote:
> Does anyone know why
>
> void main()
int main(void)
{
> double x;
> double *y;
> (int) y = x;
> }
>
> compiles well,
You can't assign to a value, only to an object. (int)y is a value, not an
object. You should get a diagnostic. Turn up your warning level.
> and why
>
> void main()
int main(void)
{
> double x;
> double *y;
> (double) y = x;
> }
>
> does not compile well ?!?
Same reason the first one shouldn't. You can't assign to a value, only to an
object. (double)y is a value, not an object.
--
Richard Heathfield :
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ:
http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc:
http://users.powernet.co.uk/eton