va_list ?? 
Author Message
 va_list ??

Hi ,
Whats the use of va_list and other va functions. I recently came across
these and was trying to find some documentation which can explain these.
I would also appreciate if someone can provide explaination here

Regards
-Rishi
--



Mon, 19 Sep 2005 09:49:53 GMT  
 va_list ??
On 03 Apr 2003 01:49:53 GMT in comp.lang.c.moderated, Rishi Pidva

Quote:

>Whats the use of va_list and other va functions. I recently came across

look in headers for function declarations containing ...

Quote:
>these and was trying to find some documentation which can explain these.

read the Standard -- US$18 from ANSI for downloadable PDF

Quote:
>I would also appreciate if someone can provide explaination here

I have discovered a truly remarkable explanation which this post
is too small to contain.

Thanks. Take care, Brian Inglis         Calgary, Alberta, Canada
--

    fake address                use address above to reply




--



Tue, 20 Sep 2005 13:10:21 GMT  
 va_list ??


Quote:
>Whats the use of va_list and other va functions. I recently came across
>these and was trying to find some documentation which can explain these.
>I would also appreciate if someone can provide explaination here

This source code ends up in almost every program I write:

#include <stdio.h>
#include <stdarg.h>

void die(char *fmt, ...)
{
    va_list ap;
    va_start(ap, fmt);
    vfprintf(stderr, fmt, ap);
    va_end(ap);
    exit(1);

Quote:
}

-andy
--



Wed, 21 Sep 2005 15:23:55 GMT  
 va_list ??

Quote:

> This source code ends up in almost every program I write:

> #include <stdio.h>
> #include <stdarg.h>

> void die(char *fmt, ...)
> {
>     va_list ap;
>     va_start(ap, fmt);
>     vfprintf(stderr, fmt, ap);
>     va_end(ap);
>     exit(1);
> }

A couple of quibbles:

The exit() function is declared in <stdlib.h>, which you didn't include.

For maximum portability, you should use exit(EXIT_FAILURE) rather than
exit(1).  On some systems (VMS in particular), exit(1) can indicate
successful termination.

--

San Diego Supercomputer Center           <*>  <http://www.sdsc.edu/~kst>
Schroedinger does Shakespeare: "To be *and* not to be"
--



Sat, 24 Sep 2005 07:31:07 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. a va_list in a va_list

2. Problem with va_list in VC++ 6.0/2002/2003 Final Beta

3. va_list, structure parameters, casting

4. va_list dynamically

5. Dynamic building of va_list ?

6. va_list passed by value/reference

7. static va_list

8. warning message with va_list

9. Problem compiling with va_list

10. Array copy/va_list/pointer prob

11. Re-using a va_list

12. va_start, va_arg, and va_list

 

 
Powered by phpBB® Forum Software