Is it true that every array that is initialized during runtime is dynamic and every array that is initialized during compiling is static?
for example:
int array[];
public main() {
array = new int[100];
}
the compiler knows how many elements the array has so it can initilize it during compiling right? or do i need to give every int a value so it becomes static? like this:
int array[3] { 1, 2, 3};
and is it posible to define how many elements an array should have outside the main() function? (without giving every int a value) like this:
int array[100];
public main() {
}
I am programming a little game and it has to run really fast. I read dynamic arrays need a bit longer to process so i want to try it with static arrays, but I am not sure when an array becomes static or dynamic.
I searched in many diffrent tutorials but i couldn't find an answer for that.
thanks for reading.