okay i have a sprite that moves on my some dimensions that i set with a random function to make it stop in random places...now it sometimes goes off the screen would this code make it reset then redo its random function again?
I don't know what it is you want to reset. If m_iRandomNumberY is not in the range 55-900 it will get a new value if that's what you mean.
We can actually simplify this line m_iRandomNumberY = rand() % ((545/6)*5) + 545/8;
to this m_iRandomNumberY = rand() % 450 + 68;
This means that m_iRandomNumberY can only be in the range 68-517 and the if statement is unnecessary.
yea thats what i wanted it to do...for the game i am making i want the sprite to choose a rand position on the screen..but if there is a certain amount already on the screen i want it to be able to move off and re random if that makes sense...