#include<iostream>
using namespace std;
void f(int arr[])
{
int a=sizeof(arr);
cout<<a;
}
int main()
{
int n;
cin>>n;
int arr[n];
int a=sizeof(arr);
cout<<a<<"\n";
f(arr);
}
Output:
24
8
Why is my output not same in both the cases even when i am printing the size of same array?