help with c++ program statement

This is a discussion on help with c++ program statement within the C++ Programming forums, part of the General Programming Boards category; I am trying to determine what the x ++ 5 does I have never seen this before, can anyone tell ...

  1. #1
    Registered User
    Join Date
    Feb 2005
    Posts
    76

    help with c++ program statement

    I am trying to determine what the x ++ 5 does I have never seen this before, can anyone tell me what it means:

    if ((x == 3) || (x ++ 5))
    y++;

    This was an answer on my test but I think it is a typo or something because I never seen it before and I got the answer wrong because of it.

  2. #2
    Registered User
    Join Date
    Oct 2006
    Location
    Canada
    Posts
    1,243
    I dont think its correct syntax either. Have you created a small program to test this? If you got it "wrong", what is the "right" answer?

    I imagine it should be one of "x + 5" or "x++ + 5" instead.

  3. #3
    The larch
    Join Date
    May 2006
    Posts
    3,573
    While x ++ 5 is a syntax error (the two symbols form a single increment operator), x + + 5 would be valid (binary plus followed by unary plus).
    I might be wrong.

    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
    Quoted more than 1000 times (I hope).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help with my program...
    By Noah in forum C Programming
    Replies: 2
    Last Post: 03-11-2006, 06:49 PM
  2. Need help with my program, please take a look
    By Hermisky in forum C++ Programming
    Replies: 2
    Last Post: 02-02-2006, 09:13 AM
  3. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  4. Program not seeing the if statement
    By adjac in forum C++ Programming
    Replies: 2
    Last Post: 06-13-2004, 08:04 PM
  5. Replies: 3
    Last Post: 01-14-2003, 09:34 PM

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