Hi Alex,
> (...) is there a way
> to test for or find the end of the array without having the size of
> the array passed to the function?
Arrays are passed to a function by the address of the first element.
If you want to determine the end of an array you must uniquely define the
end of an array, e.g. you can define that every array you use must end
with a 0-element, regardless what type of array you are using.
The only thing you have to do is to walk straight through the array and
test for this end-member.
Its practicable to define the end-element in a way that this special
element does'nt occur in the range of values that are used by your data.
Another way is to handle special elements by using escape-sequences:
You define value x as escape sequence. When x is encountered
the next element is tested. If that one is x again, assume
that this two elements mean one x, else that value is the
special data (maybe the end of the array or something else)
bye
Frank
--- XPoint
---------------
* Origin: Alles ist relativ ... (2:245/6837.11)
|