Possible Duplicate:
How to find the sizeof(a pointer pointing to an array)
I declared a dynamic array like this:
int *arr = new int[n];   //n is entered by user 
Then used this to find length of array:
int len = sizeof(arr)/sizeof(int);
It gives len as 1 instead of n . Why is it so?
 
     
     
     
    