When I make a static array, like so:
int myArray[100];
Will the array 400 bytes big, right away? or will it only assign the memory when it's actually needed?
eg; if I was then to call int myArray[64] = 5; the array would then be 4 bytes.
I have the same question for dynamic arrays, if I done:
int *myArray = new int[100];
Would it then be 400 bytes big, or only assign the memory as needed?
int myArray[100];
Will the array 400 bytes big, right away? or will it only assign the memory when it's actually needed?
eg; if I was then to call int myArray[64] = 5; the array would then be 4 bytes.
I have the same question for dynamic arrays, if I done:
int *myArray = new int[100];
Would it then be 400 bytes big, or only assign the memory as needed?
Comment