RE: [GD-General] Variables scope
Brought to you by:
vexxed72
From: Jamie F. <ja...@qu...> - 2004-02-04 09:41:48
|
that's just the way msvc6 is and always has been (i think maybe they added an option at some point to switch the behaviour?), its scoping of variables declared in for statements just violates the standard because microsoft (obviously!) know better. Fortunately they recovered in msvc7. jamie -----Original Message----- From: gam...@li... [mailto:gam...@li...]On Behalf Of CAVEY GERARD Sent: 04 February 2004 09:11 To: 'gam...@li...' Subject: [GD-General] Variables scope Hi there Few days ago i switched to Visual c++ 6.0 and this is what i discovered. The compiler accept the following C++ code : //first loop for(unsigned long b=0;b<MeshesArray[current].VerticesCount;b++) { ...//processing } //second loop for( b=0;b<not_used*3;b++) { ... } But i thiink i should write the second FOR like this "for(unsigned long b=0;b<not_used*3;b++)" (i mean i should redeclare 'b' because it came out of scope) When i tried the compiler answered me "error redefinition ..." !!! Did i forget to set an option ;it is a bit strange isn t it? Greetings GC ************************************************************************* Ce message et toutes les pieces jointes (ci-apres le "message") sont confidentiels et etablis a l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisee est interdite. Tout message electronique est susceptible d'alteration. SG Asset Management et ses filiales declinent toute responsabilite au titre de ce message s'il a ete altere, deforme ou falsifie. Découvrez l'offre et les services de SG Asset Management sur le site www.sgam.fr ******** This message and any attachments (the "message") are confidential and intended solely for the addressees. Any unauthorised use or dissemination is prohibited. E-mails are susceptible to alteration. Neither SG Asset Management nor any of its subsidiaries or affiliates shall be liable for the message if altered, changed or falsified. ************************************************************************* ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ Gamedevlists-general mailing list Gam...@li... https://lists.sourceforge.net/lists/listinfo/gamedevlists-general Archives: http://sourceforge.net/mailarchive/forum.php?forum_idU7 |