Hi
I deleted my original post, since Nebulus posted the solution in the meantime.
A little correction, however
should be modified toCode:if(length < 0) { return 0; }
otherwise "array[length-1]" can access "array[-1]".Code:if(length == 0) { return 0; }
Another remark: "int array[]"
Nebulus has chosen this way to define the function arguments.
Another way is to use "int *array". The advantage of these two
compared with "int array[9]" is that arbitrary array-sizes are
allowed.
You actually should pass, as Nebulus did, "our_array", rather than "our_array[]".when i pass our_array[] to a count function i know for a fact you don't have to specify elements
Or, if you wish, "&(our_array[0])"
Cheers.






Reply With Quote