newbie question - if statements without conditions

This is a discussion on newbie question - if statements without conditions within the C++ Programming forums, part of the General Programming Boards category; Hello, trying to understand some code I've been using and I often come across if statements without actual conditions. for ...

  1. #1
    c_h
    c_h is offline
    Registered User
    Join Date
    Jun 2008
    Posts
    5

    newbie question - if statements without conditions

    Hello,
    trying to understand some code I've been using and I often come across if statements without actual conditions. for example:

    Code:
    if(bcs)
    {
     statements
    }
    (bcs is an integer here)

    why is there no condition statement? is there a default for if statements (enter the loop if bcs is defined?)?

    thanks

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    bcs is false if it is zero. bcs is true if it is not zero.

  3. #3
    c_h
    c_h is offline
    Registered User
    Join Date
    Jun 2008
    Posts
    5
    thanks!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. While Statements Question
    By thekautz in forum C++ Programming
    Replies: 4
    Last Post: 11-09-2008, 02:48 PM
  2. Stupid Newbie question
    By TimL in forum C++ Programming
    Replies: 4
    Last Post: 07-22-2008, 05:43 AM
  3. Newbie with Very Newbie Question
    By Jedi_Mediator in forum C++ Programming
    Replies: 18
    Last Post: 07-01-2008, 09:00 AM
  4. C prog newbie question
    By Draginzuzu in forum C Programming
    Replies: 1
    Last Post: 02-03-2003, 06:45 PM
  5. a stupid question from a newbie
    By newcomer in forum C++ Programming
    Replies: 4
    Last Post: 01-11-2003, 04:38 PM

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