sorry for late respond...
as prposed by Beast():
you should follow itsme's advice and call the function twice, once for each array.
in order to do so modified function:
Code:
void count(int *array, int *size)
{
int i;
int cntr;
cntr=0;
for (i=0;i<N-1;i++)
{
if (array[i])
cntr++;
}
*size=cntr;
}
not sure of how to write the main for it. thats what I did:
Code:
void main()
{
int i;
int array1[N] = {2,3,4,5,6,7,8,9};
int array2[N] = {9,8,7,6};
int *size1, *size2;
count (array1, size1);
count (array2, size2);
}
Problem, anyways, still persists, with no change. I get the same value for both pointers.