I have an array
int[] array = new int[10]{...}
I need to use this array length in different places inside my program.
Is it good practice to get it in variable like
int n = array.Length
and use the variable n everywhere?
Or I can simply use
array.Length
everywhere it is needed.. since it is simple one , not a big calculation ?
Is there any significant difference in terms of time and space taken between these two approach?