Is there a benefit in using short and long instead of int and double? Other than int and double taking up more storage? My professor penalizes code that uses int and double with no explanation. I have not really found a good reason for it in the few textbooks I am using. Where can they be more useful? For example, this one of many functions in my code
void randDir(int& x, int& y){
do{
x = rand() % 4 - 1;
y = rand() % 4 - 1;
if(x == 2) x=0;
if(y == 2) y=0;
}while(x == 0 && y == 0);
}
And this is what my professor wanted
void randDir(short& x, short& y){
do{
x = rand() % 4 - 1;
y = rand() % 4 - 1;
if(x == 2) x=0;
if(y == 2) y=0;
}while(x == 0 && y == 0);
}