newbie question: the for loop

This is a discussion on newbie question: the for loop within the C++ Programming forums, part of the General Programming Boards category; I never actually cared much about this till now: What is executed first? the iteration expression or the conditional expression?...

  1. #1
    Back after 2 years Panopticon's Avatar
    Join Date
    Dec 2002
    Posts
    262

    newbie question: the for loop

    I never actually cared much about this till now:
    What is executed first? the iteration expression or the conditional expression?
    I AM WINNER!!!1!111oneoneomne

  2. #2
    Registered User
    Join Date
    Nov 2002
    Posts
    1,109
    for(int i = 0; i < number; i++)

    so, initialization, then condition, then loop update.

  3. #3
    Back after 2 years Panopticon's Avatar
    Join Date
    Dec 2002
    Posts
    262
    a ; while ( b ) { d; c; }
    Oh I understand why I was experiencing trouble now!
    before i thought the iteration ( c; ) was executed right after b.
    thanx
    I AM WINNER!!!1!111oneoneomne

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Stupid Newbie question
    By TimL in forum C++ Programming
    Replies: 4
    Last Post: 07-22-2008, 04:43 AM
  2. C prog newbie question
    By Draginzuzu in forum C Programming
    Replies: 1
    Last Post: 02-03-2003, 05:45 PM
  3. a stupid question from a newbie
    By newcomer in forum C++ Programming
    Replies: 4
    Last Post: 01-11-2003, 03:38 PM
  4. confusion with integers (newbie question)
    By imortal in forum C Programming
    Replies: 7
    Last Post: 12-06-2002, 03:09 PM
  5. newbie class templates question
    By daysleeper in forum C++ Programming
    Replies: 2
    Last Post: 09-18-2001, 09:50 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21