sir please tell me where should we use pointers for arrays and where we not use pointers.
Recursion first occurance
are you taking about dynamic memory allocation??
int*arr=new int[n];
this thing?
During Recursion we are sometime using pointer and sometime we are not Using. So tell me where we have to use pointer
correct reason for this is
In C++, array parameters are treated as pointers So the expression sizeof(arr)/sizeof(arr[0]) becomes sizeof(int *)/sizeof(int) which results in 1 for IA 32 bit machine (size of int and int * is 4) irrespective of the size of the array.
Therefore, sizeof should not be used to get number of elements in such cases. A separate parameter for array size (or length) should be passed to fun().
you can use pointers instead of array always