I found out that I can increase the value of a variable inside an if statement like so:
int limit = 100;
int nrCopies = 2;
int maxValue = 100;
for(int i = 0; i < limit; ++i)
{
if((nTotal += (nrCopies)) > maxValue)
break;
}
This works, and I became acostumed to do this, but I want to know if it is a good practice to do so, since I don't want to get bad habits unnecessarily