Hi all,
Consider the following code snippet:
do
{
int r = rand () ;
} while (r != 0) ;
It seems the compiler I'm using (GCC) does realise that the
scope of variable r extends the end of the while's conditional.
Questions:
- Is this correct according to the ISO/ANSI C standards?
- If so, can someone point me to the section of the ISO
C99 stanard whic defines this?
TIA,
Erik
--
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
Of the four project development variables - scope, cost, time and
quality - quality isn't really a free variable. The only possible
values are "excellent" and "insanely excellent", depending on
whether lives are at stake." -- Kent Beck, XP Explained