Answer the question
In order to leave comments, you need to log in
Increment int multiple times?
Hello. I wrote the following code (I used SFML):
int q = 0;
if (Keyboard::isKeyPressed(Keyboard::LShift))
{
q++
}
if (q == 1)
{
...
}
if (q == 2)
{
...
}
Answer the question
In order to leave comments, you need to log in
Move the variable declaration out of the loop
int q = 0;
can you tell me how to limit the increase by change? So that it increases only by 1 unit, no more
if(q != 1) {
q++;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question