Quote:
What will be the difference if i change the value from 0 to 10?
What value? There is no "0"!
Look at the line of code, and break it down:
int *arr=new int[size];
int Integers are involved.
int * It's a pointer to an intger
int *arr The is called "arr" and it holds a pointer to an integer
int *arr=new We want a new lump of memory allocated at run time.
int *arr=new int The new memory will be integer(s)
int *arr=new int[...] The new memory is an array of integers
int *arr=new int[size]
Allocate at run time an array of integers - the contents of
size
says how many integers the array will hold, and store a pointer to the first element in
arr