i am making a basic fruit machine program and i require this kinda thing
but this doesnt work.Code:if(reel1 == reel2 == reel3)
{
cout << "you win!" << '\n';
}
can someone help me out . Also why doesnt the above work?
Thanks.
Printable View
i am making a basic fruit machine program and i require this kinda thing
but this doesnt work.Code:if(reel1 == reel2 == reel3)
{
cout << "you win!" << '\n';
}
can someone help me out . Also why doesnt the above work?
Thanks.
it is comparing the first part and seeing that as true when evaluating the second part...
use:
Code:(reel1 == reel2) && (reel2 == reel3)
thanks for that korn1699. I can sod off to bed now!