I have the following doubts:
- What is the difference between compile time and run time?
- Can we initialize an array in dynamic Memory allocation just like we do for a variable?
- How does dynamic Memory allocation saves memory in case of arrays?
I mean in both the cases, that is, dynamic and static run, we need to specify the size. - In dynamic Memory allocation of arrays, what will happen if all the spaces are not occupied as specified in the syntax
int *var= new int(n) ?