i have written the following code. The std::size() function ist executing properly in the main() function but not in the getMin() function. Why?
#include <iostream>
int getMin(int numbers[]) {
int temp = numbers[0];
int sizeA = std::size(numbers);
for (int i = 1; i < sizeA; i++) {
if (temp > numbers[i])
temp = numbers[i];
}
return temp;
}
int main()
{
int numbers[5] = { 5, 5, -2, 29, 6 };
std::cout << getMin(numbers) << " with Size of "<< std::size(numbers) << std::endl;
std::cin.get();
}