I want to understand how to know the size of array without using sizeof and not in main function. and i really want to understand why my code not working when i do it in other function.(in main it works same as sizeof). >>> The rasult i got are some trash numbers
*with char array is understood but i dont know how to do it with other data specifiers.
#include <stdio.h>
void arrSize(int a[],int b[]){
int size_a = *(&a+1) - a;
int size_b = *(&b+1) - b;
printf("%d,%d",size_a,size_b);
}
int main(){
int arr[] = {2,12,14,16};
int brr[] = {8,53,2,4,16};
arrSize(arr,brr);
return 0;
}