int a[2]={2,3 }; The two elements of a account for 8 bytes: 0x00 0x00 0x00 0x00 0x00 0x00 0x00.
Then strlen(a) starts at 0x02 and ends at 0x00, so the length 1 is returned. If a[0] is assigned to 257, it will return 2, a[0] to 65793, it will return 3, and A [0] to 16843009, it will return.
The array as a function parameter is just a pointer, and the length of a 32-bit system is 4.
a =(int *)malloc(2);
printf("%d\n ",strlen(a)); This result is uncertain. The value of *a is random, and the value in the address after a is also random. Strlen will read from A until it reaches 0. In your example, the18th byte after reading A is 0, so it returns 17.