Wrapping a number around itself
This is what im trying to do. Say for instance i have a variable of type int which keeps track of the time. The variable takes numbers 1 to 12. Every time the int is incremented it represents another hour. Howerver when the number gets to 12 instead of incrementing to 13 it should go back to itself.
I know this can be done using if statements to reset it. But in another programming language there was a built in command that dealt with it (i believe it was called mod). Im guessing there is a C++ alternative to this command but cannot seem to find one.