Thread: Newbish concern regarding "if" command

  1. #1
    Registered User
    Join Date
    Jun 2008
    Posts
    2

    Newbish concern regarding "if" command

    In the following code:
    Code:
    if (sys.readErr != 0 || 1) {...
    Does the parser read it like:

    [ sys.readErr != 0 ] || 1

    OR

    sys.readErr != [0 || 1] ?

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    The first.

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675
    The former.

    You need to use
    Code:
    if (sys.readErr != 0 || sys.readErr != 1) { ...

  4. #4
    Registered User
    Join Date
    Jun 2008
    Posts
    2
    Wow, fast response. Thanks much guys!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 26
    Last Post: 07-05-2010, 10:43 AM
  2. Multiple arguments in the "if" command
    By |Wiz| in forum C++ Programming
    Replies: 11
    Last Post: 09-28-2005, 12:01 PM
  3. Batch file programming
    By year2038bug in forum Tech Board
    Replies: 10
    Last Post: 09-05-2005, 03:30 PM
  4. Ping problem
    By bladerunner627 in forum C++ Programming
    Replies: 12
    Last Post: 02-02-2005, 12:54 PM
  5. begginer: having trouble with "if" command.
    By imortal in forum C Programming
    Replies: 2
    Last Post: 01-08-2003, 08:34 PM