vprintf man page on Ultrix

Man page or keyword search:  
man Server   3690 pages
apropos Keyword Search (all sections)
Output format
Ultrix logo
[printable version]

vprintf(3s)							   vprintf(3s)

Name
       vprintf, vfprintf, vsprintf - print formatted output of a varargs argu‐
       ment list

Syntax
       #include <stdio.h>
       #include <varargs.h>

       int vprintf (format, ap)
       char ∗format;
       va_list ap;

       int vfprintf (stream, format, ap)
       FILE ∗stream;
       char ∗format;
       va_list ap;

       int vsprintf (s, format, ap)
       char ∗s, ∗format;
       va_list ap;

Description
       The and routines are the same as and respectively, except that  instead
       of  being  called  with a variable number of arguments, they are called
       with an argument list as defined by

Examples
       The following demonstrates how could be used to write an error routine.
       #include <stdio.h>
       #include <varargs.h>
	    .
	    .
	    .
       /∗
	∗   error should be called like
	∗	 error(function_name, format, arg1, arg2...);
	∗/
       /∗VARARGS0∗/
       void
       error(va_alist)
       /∗ Note that the function_name and format arguments cannot be
	∗ separately declared because of the definition of varargs.
	∗/
       va_dcl
       {
	   va_list args;
	   char ∗fmt;

	   va_start(args);
	   /∗ print out name of function causing error ∗/
	   (void)fprintf(stderr, "ERROR in %s: ", va_arg(args, char ∗));
	   fmt = va_arg(args, char ∗);
	   /∗ print out remainder of message ∗/
	   (void)vfprintf(stderr, fmt, args);
	   va_end(args);
	   (void)abort( );
       }

See Also
       varargs(3)

								   vprintf(3s)
[top]

List of man pages available for Ultrix

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net