Newbish concern regarding "if" command

This is a discussion on Newbish concern regarding "if" command within the C Programming forums, part of the General Programming Boards category; In the following code: Code: if (sys.readErr != 0 || 1) {... Does the parser read it like: [ sys.readErr ...

  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,185
    The first.

  3. #3
    a_capitalist_story
    Join Date
    Dec 2007
    Posts
    2,649
    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, 11:54 AM
  5. begginer: having trouble with "if" command.
    By imortal in forum C Programming
    Replies: 2
    Last Post: 01-08-2003, 07:34 PM

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