View Poll Results:

20. You may not vote on this poll
  • do-while

    4 20.00%
  • while

    13 65.00%
  • I never use any of these

    1 5.00%
  • Who cares

    2 10.00%

Thread: do-while vs while

  1. #31
    Registered User
    Join Date
    Oct 2001
    I could be wrong, but I think do-while and while were part of the original C language, and basically C++ just inherited them.

  2. #32
    Registered User
    Join Date
    Sep 2002
    I'm with some of the other guys.

    Each is useful in different contexts. If you don't need to go into the loop at least once, why bother.


  3. #33
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Because sometimes you only want to go into the loop if a certain condition is true; thus, with a while loop, you can cut out an extra if statement which might make your code uglier.
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  4. #34
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    The poll is now closed.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

Popular pages Recent additions subscribe to a feed