I saw this code and unable to understand the output of code. In main function sizeof(a) prints 40. But when i pass the array to function, sizeof(arr) print 8. Anyone can explain the behaviour??
#include <iostream>
using namespace std;
void findSize(int arr[]){
cout<<sizeof(arr)<<endl;
}
int main() {
int a[10];
cout<<sizeof(a)<<" ";
findSize(a);
return 0;
}