There is no "official" equivalent of \0 for integers, but you can certainly use your own value. For example, if your integers represent distances, then you can use -1 (not a valid distance) as a reference value to indicate the end of the array.
If your integer array can reasonably contain any int value, you can pass the size of the selected array with an additional parameter to your function.
Greg hewgill
source share