Michael said:
I am far from being an expert in C so please
correct me if am wrong, but
in the FAQ 15.8 states that there no way to do
this. So I guess you have to pass this information
as the first parameter.
You are correct that the C language does not provide any mechanism for
detecting the end of a list of arguments. So, for the OP to write a
function taking a list of integers without using a sentinel value, such
as 0 or MIN_INT to indicate the end of the list, the only option is to
pass the number of elements and it makes sense for this to be the first
parameter.
Please include enough context in your reply for people to see what you
are replying to. Usenet does not guarantee that people receive messages
in order and, even if they do, they might have read the message you are
replying to a few weeks before they read your reply if they happen to go
on holiday before seeing your reply. So without the context you reply
will often make absolutely no sense.