easy comparison question

This is a discussion on easy comparison question within the C++ Programming forums, part of the General Programming Boards category; i am making a basic fruit machine program and i require this kinda thing Code: if(reel1 == reel2 == reel3) ...

  1. #1
    Registered User
    Join Date
    Aug 2001
    Posts
    84

    easy comparison question

    i am making a basic fruit machine program and i require this kinda thing

    Code:
    if(reel1 == reel2 == reel3)
    {
        cout << "you win!" << '\n';
    }
    but this doesnt work.
    can someone help me out . Also why doesnt the above work?

    Thanks.

  2. #2
    Registered User
    Join Date
    Nov 2001
    Posts
    241
    it is comparing the first part and seeing that as true when evaluating the second part...

    use:
    Code:
    (reel1 == reel2) && (reel2 == reel3)

  3. #3
    Registered User
    Join Date
    Aug 2001
    Posts
    84
    thanks for that korn1699. I can sod off to bed now!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. easy Vector contructor question
    By noodle24 in forum C++ Programming
    Replies: 5
    Last Post: 04-21-2006, 08:43 PM
  2. Another Embarassingly Easy Question
    By almo89 in forum C Programming
    Replies: 2
    Last Post: 02-11-2006, 04:59 PM
  3. This is hopefully an extremely easy question...
    By rachaelvictoria in forum C Programming
    Replies: 2
    Last Post: 11-07-2005, 01:36 AM
  4. 4 easy question
    By Zeratulsdomain in forum C++ Programming
    Replies: 2
    Last Post: 10-15-2005, 11:43 PM
  5. Easy Question
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 08-12-2002, 01:19 PM

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