Can u anybody of u explain me how the following statement works??
y=x++<=5;:!:
himanjim 0 Junior Poster in Training
Recommended Answers
Jump to Post— Dave Sinkula 2,398If x is less than or equal to 5, y is set to 1 -- otherwise y is set to 0; x is then incremented.
But better would be for you to ask, "I think that this statement does [...]. Is this correct?" Or at least provide a (minimal, …
Jump to Post— WolfPack 491If x is less than or equal to 5, y is set to 1 -- otherwise y is set to 0; x is then incremented.
Is x incremented before or after the result of the comparison is assigned to y? Correct me if I am wrong in the explaination below. …
Jump to Post— Dave Sinkula 2,398Is x incremented before or after the result of the comparison is assigned to y?
After.
Correct me if I am wrong in the explaination below.
y=x++<=5;is equivalent toy=(x++<=5);.
The part inside the brackets should be evaluated first. So doesn't that mean the binary comparison and the …
Jump to Post— WolfPack 491So the error was this statement?
y=x++<=5;is equivalent toy=(x++<=5);.
All 13 Replies
Dave Sinkula 2,398 long time no c Team Colleague
WolfPack 491 Posting Virtuoso Team Colleague
Dave Sinkula 2,398 long time no c Team Colleague
WolfPack 491 Posting Virtuoso Team Colleague
Dave Sinkula 2,398 long time no c Team Colleague
himanjim 0 Junior Poster in Training
WolfPack 491 Posting Virtuoso Team Colleague
himanjim 0 Junior Poster in Training
Dave Sinkula 2,398 long time no c Team Colleague
WolfPack 491 Posting Virtuoso Team Colleague
Dave Sinkula 2,398 long time no c Team Colleague
WolfPack 491 Posting Virtuoso Team Colleague
Dave Sinkula 2,398 long time no c Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.