I try to create a program in which in the main I declare an array and load it elements. There is also a function that counts the number of elements in the array but when I want to show the result, a memory address appears instead of the number of elements and the warning above.
The code:
#include <stdio.h>
#include <conio.h>
int countArrayElement(int arr[]);
int main()
{
int intMyArray[]= {1,2,3,4,6,7};
countArrayElement(intMyArray);
printf("The quantity of elements in the array is %d",&countArrayElement);
getch();
return 0;
}
int countArrayElement(int arr[])
{
int count = 0;
count = sizeof (arr)/sizeof(int); // wont work at all, arr is just the first element
return count;
}