Sizeof use doubt

why can’t we use sizeof() here?

And how to find length then ?

hello @prerak_semwal

the compiler will treat a[] as a pointer.
so sizeof(a)/size(int) will give pointer size/size of int
which is definitely not the array size.

u need to explicitly pass length of array in function argument

@aman212yadav
“which is definitely the array size” ?

corrected -> which is definitely not the array size…