i am not able to understand this run time allocation , int *arr = new int[30] will create a array and also int a[30] will do the same so what is the difference?? and if we talk about dyamic memory if the input during runtime came to be 31 does it will manage that??
Not able to understand concept of memory allocation
hi kushal
if u do a[30]
then user input n=31 then it will be a wrong case as the memory u have allocated is only for 30 interger
but if u do int *a=new int[n]
it will allocated the memory in heap and is adjusted by the compiler automatically
as if u want to delete memory allocated in heap u need to delete as it is not automatically deleted