Re: how to use va_list

From: Flash Gordon (spam_at_flash-gordon.me.uk)
Date: 02/21/05


Date: Mon, 21 Feb 2005 12:17:14 +0000

Michael wrote:
> 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.

-- 
Flash Gordon
Living in interesting times.
Although my email address says spam, it is real and I read it.


Relevant Pages

  • Re: how to use va_list
    ... > Michael wrote: ... >> as the first parameter. ... > replying to a few weeks before they read your reply if they happen to go ... So without the context you reply ...
    (comp.lang.c)
  • Re: mark load module non-executable
    ... would you please quote the orignal post when replying? ... It is not clear to me who appointed Mr. Comstock to the post of IBM-MAIN list invigilator or even that such a post exists or should do. ... but why do you take the position of never including context ... For IBM-MAIN subscribe / signoff / archive access instructions, ...
    (bit.listserv.ibm-main)
  • Re: old pentium
    ... >> you are replying to apart from what I can see quoted above. ... to let people know WHICH bit of context you are talking about. ... How on earth would you know what THIS sentence were talking about, ... if you had not read the quoted sentence that it IS talking about? ...
    (alt.os.linux)
  • Re: Distance between a point and y = ax^2 + bx + c
    ... Quote the message you are replying to, ... Click on the "Quote Original" ... provide context, ... some values of x0 and y0 I get only imaginary roots. ...
    (sci.math)
  • Re: advantages of forth over other languages
    ... Intelligent quoting trims text to just what is necessary to know the context of a reply. ... You'll note that the first sentence of my message was "that old theme again" which should suggest that I am not just replying to John's then-current message, but to larger themes he has offered in past discussions. ...
    (comp.lang.forth)