Quote Originally Posted by QuestionKing View Post
Code:
const short REPEATS = 10;
for(short i=0; i<REPEATS; i++)
{
       std::cout<< "...\n";
}
Would it make a difference to use short here instead of int?
Only if you want to burden the maintainer with needing to remember to change the data type if he/she ever wants to change REPEATS to some value larger than a short could hold.

At any rate, since REPEATS is a small constant, the compiler might unroll the loop anyway.

Another concern is that the value is signed. I suggest that normally, loop counters and array indices should be unsigned.