Your ternary expr is almost there, just needs (1) brackets to get the order of evaluation right and (2) it has to be used in an assignment kind of way
for (j = y1 ; j != y2; j = j + ((y1 < y2) ? 1 : -1))
Reputation Points: 1907
Solved Threads: 951
Posting Expert
Offline 5,768 posts
since Apr 2008