in reply to •Re: If Statement
in thread If Statement

Re: point 3: Maybe that C doesn't have naked blocks? So would if($cond) { $foo } $bar; mean
if($cond) { $foo } $bar;
or is it
if($cond) { { $foo; } $bar; }

Makeshifts last the longest.

Replies are listed 'Best First'.
•Re: Re^2: If Statement
by merlyn (Sage) on Nov 06, 2002 at 18:42 UTC
      Oh wow. I had no idea - never seen one in a C source.

      Makeshifts last the longest.

        naked blocks can be useful in C, because they allow you to declare variables somewhere in a function other than at the start, for example -
        void MyFunction() { int a = 10; printf ("%d",a); { int b = 5; printf ("%d",b); } }

        The following would be illegal in C -
        void MyFunction() { int a = 10; printf ("%d",a); int b = 5; printf ("%d",b); }