Thread: Having Trouble with boolean

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    May 2008
    Posts
    2

    Having Trouble with boolean

    Hey guys

    i've just started learning C++ and im stuck with boolean

    in the tutorial it shows:


    Code:
    A. !( 1 || 0 )         ANSWER: 0	
    B. !( 1 || 1 && 0 )    ANSWER: 0 (AND is evaluated before OR)
    C. !( ( 1 || 0 ) && 0 )  ANSWER: 1 (Parenthesis are useful)
    When i put one of these in Dev-C++ tells me: expected unqualified-id before '!' token

    if someone could tell me what i am doing wrong it would be great.

    Thanks

    P.S sorry huys, i accidently posted this twice
    My apologies
    Last edited by jazza_rockz; 05-13-2008 at 04:37 AM. Reason: had to apologise for posting twice

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Novice needs help
    By ghaasemi in forum C++ Programming
    Replies: 9
    Last Post: 05-30-2009, 08:20 AM
  2. Bolean Operators hurt my head. (Trouble understanding) :(
    By Funcoot in forum C++ Programming
    Replies: 3
    Last Post: 01-20-2008, 07:42 PM
  3. Replies: 4
    Last Post: 04-02-2004, 07:30 PM
  4. Use struct to create a boolean type
    By skyglin in forum C Programming
    Replies: 6
    Last Post: 06-18-2003, 08:21 PM