🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

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

#2489
From: Alex Martelli
Date: Thu, 09 Nov 1995 19:28
31 lines
1356 bytes
sjc@netcom.com (Steven Correll) writes:
	...
>Must portable programs do this?
>	for (unsigned i0 = 0; ...; ...)
>	  ...
>	for (unsigned i1 = 0; ...; ...)

No,

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

has exactly the same semantics as the old rule, so, if you want to
keep portability to older compilers, you can perfectly well use this.


Alex
--
DISCLAIMER: these are TOTALLY personal opinions and viewpoints, NOT connected
in any way with my employer, nor any other organization or individual!
Email: martelli@cadlab.it                            Phone: +39 (51) 597313
CAD.LAB s.p.a., v. Ronzani 7/29, Casalecchio, Italia   Fax: +39 (51) 597120

---
[ 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: <martelli.815930136@cadlab>
Path: arc1-ca.pugleaf.net!128.32.155.1!matt
References: <47itjt$65m@lhc.nlm.nih.gov> <sjcDHqMKM.MBG@netcom.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!128.32.155.1!matt
From: martelli@cadlab.it (Alex Martelli)
Newsgroups: comp.std.c++
Subject: Re: New treatment of 'for (int i ...'
Date: 09 Nov 1995 19:28:59 GMT
Organization: Cad.Lab Spa, Bologna, Italia
Approved: matt@physics2.Berkeley.EDU (Matt Austern)
Message-ID: <martelli.815930136@cadlab>
References: <47itjt$65m@lhc.nlm.nih.gov> <sjcDHqMKM.MBG@netcom.com>
NNTP-Posting-Host: physics2.berkeley.edu