another quick n easy question

This is a discussion on another quick n easy question within the C Programming forums, part of the General Programming Boards category; regarding DO..WHILE.. loops Code: int variable; do { blah; blah; blah; } while ( variable ); the loop executes once ...

  1. #1
    Registered User
    Join Date
    Nov 2005
    Posts
    10

    another quick n easy question

    regarding DO..WHILE.. loops

    Code:
    int variable;
    
    do {
        blah;
        blah;
        blah;
         } while ( variable );

    the loop executes once at least, and then repeats if the condition specified between the parenthesis is TRUE. i am working with an example that doesn't use an expression, only a integer variable name as the condition. what determines when the variable will evaluate to TRUE and when to FALSE?

  2. #2
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,006
    Whether or not its value is zero (FALSE) or nonzero (TRUE).
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  3. #3
    Registered User
    Join Date
    Nov 2005
    Posts
    10
    of course..thanks for that

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Easy String position question...
    By Striph in forum C Programming
    Replies: 4
    Last Post: 05-11-2009, 09:48 PM
  2. Quick Easy Question
    By St0rmTroop3er in forum A Brief History of Cprogramming.com
    Replies: 6
    Last Post: 02-24-2004, 01:08 AM
  3. Quick Question on File Names and Directories
    By Kyoto Oshiro in forum C++ Programming
    Replies: 4
    Last Post: 03-29-2002, 02:54 AM
  4. * quick question *
    By SavesTheDay in forum C Programming
    Replies: 3
    Last Post: 03-27-2002, 06:58 PM
  5. Quick question: exit();
    By Cheeze-It in forum C Programming
    Replies: 6
    Last Post: 08-15-2001, 06:46 PM

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