From: Erik Max Francis Newsgroups: comp.os.msdos.djgpp Subject: Re: Converting doubles to ints and chars!? Date: Wed, 23 Jul 1997 00:48:13 -0700 Organization: Alcyone Systems Lines: 27 Message-ID: <33D5B73D.21F7B9CE@alcyone.com> References: <33d535b4 DOT 193109 AT news DOT algonet DOT se> <33D53467 DOT 259F AT cs DOT com> NNTP-Posting-Host: newton.alcyone.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk John M. Aldrich wrote: > > Maybe its not supposed to be done this way at all but the > > compiler does'nt complain about it!! > > It may be that the compiler thinks you are declaring X in that > statement, and therefore allocates an automatic variable. Y would then > be assigned the value of that uninitialized variable. It's strange... > and only possible in C++. If you compiled that as C it would have > caused a syntax error. Not sure what the original poster could be referring to: double f; unsigned char uc; uc = (unsigned char f); is a compile error in both C and C++. -- Erik Max Francis, &tSftDotIotE / email / max AT alcyone DOT com Alcyone Systems / web / http://www.alcyone.com/max/ San Jose, California, United States / icbm / 37 20 07 N 121 53 38 W \ "Love is not love which alters / when it alternation finds." / William Shakespeare, _Sonnets_, 116