I am trying to learn pointers which is a real PITA when you don't quite fully understand it.
I am trying to print all the elements in the array but only the first element is printed.
#include <stdio.h>
int count(const int* numbers, int size)
{
for(; numbers < size; numbers++)
{
printf("%d", *numbers);
}
}
int main(void)
{
int numbers[] = {3, 4, 6, 3, 46};
int result = count(numbers, 5);
printf("%d\n", result);
return 0;
}
The loop in the count function does not seem to work properly since it is only looping through one time but I can't understand why.