int a[]={1,3,4,5,7};
int b[]={2,3,5,6};
int m=sizeof(a)/sizeof(int);
int n=sizeof(b)/sizeof(int);
cout<<m<<" "<<n<<endl;
this code prints 5,4. but when i pass the arrays to some function and then i print the m,n values then it is printing 1,1. i know that they are acting as pointer when i pass then in function and sizeof pointer is 4 bytyes and so of int. so it is 1. but why is it not same in main function ? any specific reason ? thanks alot.