This is a discussion on Can someone explain what this means?? within the C++ Programming forums, part of the General Programming Boards category; Code: if(lines++%20==19)...
This is simply testing to see if the reamainder (modulous %) of dividing the value contained in lines by 20 is equal to 19. I imagine this statement is contained in a loop because the value of lines is then incremented by one. Hope that helps. Have a nice day.
Hi, dont fully understand that, but nearly..
How would I write a program that put certain lines of a text file onto a certain x,y on the screen.
lines++ // incremant the value contained in lines by 1. If lines == 16, lines++ sets lines to 17Originally posted by JamMan
lines++ % 20 // divide lines by 20 and find the remainder. If lines == 25, lines % 20 == 5.
lines++ % 20 == 19 // if that remainder == 19
There could be a problem with lines++ as to when it increments: before or after the modulus operation. This stuff causes weird problems, and there are threads on the board about this if you search. I think it's compiler dependant, but check first.
Cheers Brown Drake think I got it now.