How *(&arr + 1) - arr is working to give the array size [duplicate]
32
int arr[] = { 3, 5, 9, 2, 8, 10, 11 };
int arrSize = *(&arr + 1) - arr;
std::cout << arrSize;
I am not able to get how this is working. So anyone can help me with this.
c++ arrays
std::size
– Ayxan Haqverdili May 12 at 19:15sizeof(arr) / sizeof(arr[0])
, IIRC. – Solomon Ucko May 13 at 17:42