🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #2491

Re: New treatment of 'for (int i ...'

#2491
From: Mike Ferrel
Date: Fri, 10 Nov 1995 01:12
29 lines
1457 bytes
In article <sjcDHqMKM.MBG@netcom.com>, sjc@netcom.com (Steven Correll) wrote:
> Must portable programs do this?
> 
>         for (unsigned i0 = 0; ...; ...)
>           ...
>         for (unsigned i1 = 0; ...; ...)
>           ...

How about

      unsigned i;
      for(i = 0; ...; ...)
         ...
      for(i = 0; ...; ...)
         ...

This works for all compilers, and is what we all did before we could
declare it in the loop anyway.  I have used it to go back and forth
between CodeWarrior, which implements the new scope, and Borland which
does the old.

-- 
Mike Ferrel
Sonoma State University
mferrel@zippy.sonoma.edu
---
[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID: <mferrel-0911951136400001@sa-1en64.sonoma.edu>
Path: arc1-ca.pugleaf.net!in1.uu.net!bounce-back
References: <47itjt$65m@lhc.nlm.nih.gov> <sjcDHqMKM.MBG@netcom.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!in1.uu.net!bounce-back
Date: 10 Nov 95 01:12:59 GMT
Approved: fjh@cs.mu.oz.au
From: mferrel@zippy.sonoma.edu (Mike Ferrel)
Newsgroups: comp.std.c++
Subject: Re: New treatment of 'for (int i ...'
X-Original-Date: Thu, 09 Nov 1995 11:36:40 -0700
Organization: Sonoma State University
Message-ID: <mferrel-0911951136400001@sa-1en64.sonoma.edu>
References: <47itjt$65m@lhc.nlm.nih.gov> <sjcDHqMKM.MBG@netcom.com>
X-Auth: PGPMoose V1.1 PGP comp.std.c++
 iQBFAgUBMKKnKuEDnX0m9pzZAQHAOwF+MMdNP1BJS4jjKg0n4da6da+MISmHsv9k
 tYrV8A5IKbGSjcyoOL5+3Yuu4ZuLaTME
 =XYqs