Hello again,
In every book or tutorial about C language I happened to take a look, they use indexes for loops and arrays, in programs used as examples, that won't count/index but a very small number, like that:
Code:
.
.
#define MAX_LENGTH 10
int index;
int array[MAX_LENGTH];
for (index = 0; index < MAX_LENGTH; ++index)
array[index] = 0;
.
.
I have written the same examples with a minor change and they seem to compile and run fine.
Code:
.
.
#define MAX_LENGTH 10
short index;
int array[MAX_LENGTH];
for (index = 0; index < MAX_LENGTH; ++index)
array[index] = 0;
.
.
Isn't it better idea and a good practice to use a short index instead of an int since we are going to deal with very small values?
If not why ?
Thank you for your time to help me!