Thread: Is this right? if statements

  1. #1
    Frustrated Programmer :( phantom's Avatar
    Join Date
    Sep 2001
    Posts
    163

    Is this right? if statements

    I just want to double check if the following is right ->

    if (temp)
    {
    //This will be done if temp is anything except 0
    }

    if (!temp)
    {
    //This will be done if temp is 0
    }
    My site to register for all my other websites!
    'Clifton Bazaar'

  2. #2
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,138
    correct.

  3. #3
    Registered User matheo917's Avatar
    Join Date
    Sep 2001
    Posts
    279
    pretty much correct

  4. #4
    Frustrated Programmer :( phantom's Avatar
    Join Date
    Sep 2001
    Posts
    163
    thanks all, just had a bad feeling about something so I thought I had better double check it
    My site to register for all my other websites!
    'Clifton Bazaar'

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Unknown memory leak with linked lists...
    By RaDeuX in forum C Programming
    Replies: 6
    Last Post: 12-07-2008, 04:09 AM
  2. newbie question - if statements without conditions
    By c_h in forum C++ Programming
    Replies: 2
    Last Post: 07-18-2008, 10:42 AM
  3. C++ If Statements Help
    By moporho in forum C++ Programming
    Replies: 19
    Last Post: 01-18-2008, 08:40 AM
  4. Efficiency of case statements
    By Yasir_Malik in forum C Programming
    Replies: 26
    Last Post: 05-23-2006, 11:36 AM
  5. Need help with "if" statements
    By Harryt123 in forum C Programming
    Replies: 22
    Last Post: 05-14-2006, 08:18 AM