Re: how to use va_list
From: Flash Gordon (spam_at_flash-gordon.me.uk)
Date: 02/21/05
- Next message: Michael Mair: "Re: how to use va_list"
- Previous message: Kevin Bracey: "Re: Variable list in pre-processor define"
- In reply to: Michael: "Re: how to use va_list"
- Next in thread: Michael Mair: "Re: how to use va_list"
- Reply: Michael Mair: "Re: how to use va_list"
- Reply: Michael: "Re: how to use va_list"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
- Next message: Michael Mair: "Re: how to use va_list"
- Previous message: Kevin Bracey: "Re: Variable list in pre-processor define"
- In reply to: Michael: "Re: how to use va_list"
- Next in thread: Michael Mair: "Re: how to use va_list"
- Reply: Michael Mair: "Re: how to use va_list"
- Reply: Michael: "Re: how to use va_list"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|