Date: Fri, 25 Jul 1997 14:09:46 +1100 From: Bill Currie Subject: Re: Converting doubles to ints and chars!? In-reply-to: <33d535b4.193109@news.algonet.se> To: djgpp AT delorie DOT com Message-id: <199707250214.OAA09191@teleng1.tait.co.nz gatekeeper.tait.co.nz> Organization: Tait Electronics Limited MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1 Comments: Authenticated sender is Content-Transfer-Encoding: 8bit Precedence: bulk On 22 Jul 97 at 22:38, Christian Granstr÷m wrote: > double X: > unsigned char Y; > > Y = (unsigned char X); Y = (unsigned char) X; > This seems to work until i put Y into an vector. Compilator bug??? > It also works fine if I printf() Y before puting it into the vector! > > Maybe its not supposed to be done this way at all but the > compiler does'nt complain about it!! Strange. Are you using C++? If so, you can declare variables (almost) anywhere, but I would have thought you'ld get an error about redeclaration (unless X is global). Bill -- Leave others their otherness.