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++ Language Reference - vprintf, vfprintf, vsprintf 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);

   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>

   varprint(char *format,...)
   {
   va_list arg_ptr;
        va_start(arg_ptr,format);
        vprintf(format,arg_ptr);
        va_end(arg_ptr);
   }
   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 Value
   The  number of characters written if successful, or a negative  number
   on error.


See Also: fprintf printf sprintf

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