sizeof() works in main() but not in function

void myfunction (int ar[])
{
cout<<sizeof(ar)<<endl;
}
int main ()
{
int arr[3] = {1,2,3};
cout<<sizeof(arr)<<endl;\\ this gives answer 12
myfunction(arr);\\ this gives answer 4
}

I get two different sizes of same array. Why? Thanks.
Topic archived. No new replies allowed.