Thread: precedence questions

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Sep 2011
    Posts
    11

    Red face precedence questions

    true ? 1 : 2 + 3 // why is this 1? False = 0, true = 1 right? // Then why is this 1 .
    also
    24 / 6 * 2 // I got this as well.
    has value 8, not value 2; likewise, the weird-looking expression
    true ? false : true ? false : true // how? I don't understand the if true then false? false true?
    Last edited by elpedoloco; 10-01-2011 at 10:53 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. About precedence of && and ||
    By noobiept in forum C Programming
    Replies: 11
    Last Post: 09-12-2010, 06:38 PM
  2. precedence question
    By nimitzhunter in forum C Programming
    Replies: 4
    Last Post: 08-10-2010, 11:57 PM
  3. need some help for precedence
    By timhxf in forum C Programming
    Replies: 2
    Last Post: 12-15-2006, 06:19 PM
  4. precedence
    By modec in forum C Programming
    Replies: 3
    Last Post: 05-22-2003, 11:37 AM
  5. precedence
    By Unregistered in forum C Programming
    Replies: 2
    Last Post: 03-17-2002, 12:05 PM