Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ Moderated > Environment of ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 4 Topic 9428 of 10094
Post > Topic >>

Environment of for-loop-incrementation-part

by Helmut Jarausch <jarausch@[EMAIL PROTECTED] > Mar 27, 2008 at 02:41 PM

Hi,

in what environment is the incrementation-part (3rd part) of a
for loop executed?

Or, is the following example valid C++ ? (g++-4.2.2 doesn't accept it)

struct Auto_Type;
typedef Auto_Type  *Auto_ptr;

struct Auto_Type {
   Auto_ptr next;
};


int main() {
   Auto_ptr  Head = 0, Tail= 0;

   // (Verarbeiten,) Ausgabe und Löschen der Elemente

   for ( Auto_ptr Auto= Head; Auto; Auto= Auto_next ) {// valid ?
     Auto_ptr Auto_next= Auto->next;  // <<<<<<<<<<  defined only now
     delete Auto;
   }
}


Many thanks for your comment,

Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany

-- 
      [ See http://www.gotw.ca/resources/clcm.htm
for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
 




 4 Posts in Topic:
Environment of for-loop-incrementation-part
Helmut Jarausch <jarau  2008-03-27 14:41:35 
Re: Environment of for-loop-incrementation-part
Carl Barron <cbarron41  2008-03-28 10:02:49 
Re: Environment of for-loop-incrementation-part
Oliver Roese <pspftf-n  2008-04-26 16:30:24 
Re: Environment of for-loop-incrementation-part
Carl Barron <cbarron41  2008-04-27 07:12:35 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Oct 11 8:12:56 CDT 2008.