Thread: for loop and scopes

  1. #1
    Registered User
    Join Date
    Sep 2005
    Posts
    196

    for loop and scopes

    what is it usefull for...i mean it looks like the alterations of the while loop kik the for loops

    and the scope i mean whats this usefull for?if at all..
    Last edited by lilhawk2892; 07-04-2006 at 08:14 PM.

  2. #2
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Never use for loops. They are useless. And that scope thing... sheesh, they could have come up with something better, don't you think?
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  3. #3
    Registered User
    Join Date
    Sep 2005
    Posts
    196
    quote from zeuscmd.com
    You should now understand how to use probably the most widely used loop of them all. In every useful program, you will find a number of for loops.
    lol

  4. #4
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    I was hoping you got the irony. But I'm afraid you didn't.

    A while loop is usually used when one wants to process a set of expressions while a condition holds. A for loop, on the other hand (while retaining a similar principle) is better seen as a step loop.

    Both loops are similar and on most situations interchangeable. However you will soon realize that they are both needed and that on some circumstances a for loop is the only sane way to go.

    EDIT: By the way, a while loop also defines its own scope. Tough luck, eh?
    Last edited by Mario F.; 07-04-2006 at 08:58 PM.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  5. #5
    Registered User
    Join Date
    Sep 2005
    Posts
    196
    oh great your not my freind anymor!!!!
    jk

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Confused on Class scopes
    By csonx_p in forum C++ Programming
    Replies: 11
    Last Post: 07-25-2008, 03:58 AM
  2. Variable scopes; Vectors of struct's
    By relyt_123 in forum C++ Programming
    Replies: 8
    Last Post: 11-04-2007, 10:07 PM