[Insight-developers] more VC++ idiosyncrasies
Bill Hoffman
bill.hoffman@kitware.com
Mon, 04 Dec 2000 15:43:20 -0500
The #define method follows the standard and can be removed with
the next release of the microsoft compiler.
-Bill
At 03:34 PM 12/4/00 -0500, Luis Ibanez wrote:
>Another way to get around the
>
>for( int i ... )
>
>VC++ redeclaration problem is to enclose
>the "for" in brackets.
>
>You can put brackets anywhere, and
>create a local scope for variables.
>That even helps for optimization and debugging.
>
>something like:
>
>{ // begin additional bracket
> // any variable defined here has local block scope
> for( int i=0; i<n; i++) {
> ....
> }
>} // closing additional bracket, end of block scope
>
>
>{ // begin second additional bracket
> // any variable defined here has local block scope
> for(int i=0; i<n; i++)
> {
> ...
> }
>} // closing second additional bracket, end of block scope
>
>Which finally reflects the fact that both for's
>are locally concerned and that you're not counting
>on both "i" variables to be the same.
>
>
>..., it isn't pretty either, but, it is a fast solution,
>specially when this is not your own code. :-)
>
>
>------
>
>
>Luis
>
>
>
>
>--
>______________________________________________________________________
>
>Luis Ibanez
>Research Assistant Professor - Division of Neurosurgery
>University of North Carolina at Chapel Hill
>CB# 7060, Chapel Hill, NC 27599
>email : ibanez@cs.unc.edu home : http://www.cs.unc.edu/~ibanez
>phone : (919)-843-9961 fax : (919)-966-6627
>______________________________________________________________________
>
>_______________________________________________
>Insight-developers mailing list
>Insight-developers@public.kitware.com
>http://public.kitware.com/mailman/listinfo/insight-developers