Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ 3.0r4 - <b>vprintf</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
vprintf
vfprintf
vsprintf

Usage

   #include <stdio.h>
   #include <stdarg.h>
   int vfprintf(FILE *stream,const char *format, va_list arg_ptr);
   int vprintf(const char *format,va_list arg_ptr);
   int vsprintf(char *buffer,const char *format, va_list arg_ptr);

   ANSI

Description

   These functions are all similar to their counterparts printf(), fprintf()
   and sprintf() except the data is taken from the va_list arg_ptr. See
   fprintf for a description of the format commands.

Example 

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

   varprint(char *format,...)
   {
       va_list arg_ptr;
       va_start(arg_ptr,format);
       vprintf(format,arg_ptr);
       va_end(arg_ptr);
   }

   int main()
   {

       char *string = "STRING";
       int hnum = 0xb000;
       varprint("Call with a %s parm and a %x hex parm\n",
               string,hnum);
       varprint("Or with no parms\n");
       return EXIT_SUCCESS;
   }

Return Value

   The number of characters written if successful, or a negative number on
   error.

See Also

   fprintf, printf, sprintf




See Also: fprintf printf sprintf

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson