vcprintf

Writes output to the console under format control

Local Servers:blocking
Remote Servers:N/A
Classification:Other
Service:Device I/O

Syntax

  #include <stdarg.h>  
  #include <stdio.h>  
   
  int  vcprintf  (  
     const char  *format,   
     va_list      arg);
  

Parameters

format

(IN) Points to the format control string.

arg

(IN) Specifies a variable argument.

Return Values

The vcprintf function returns the number of characters written, or a negative value if an output error occurred. If an error occurs, errno is set.

Remarks

The vcprintf function writes output to the console under control of the argument format. The format string is described under the description for printf. The vcprintf function is similar to printf, with the variable argument list replaced with arg, which has been initialized by the va_start macro.

See Also

fprintf and printf (Single and Intra-File Services), sprintf, va_arg, va_end, va_start (NLM and NetWare: Program Management), vprintf (Single and Intra-File Services)

Example

The following example shows the use of vcprintf in a general error message routine.

  #include   <stdarg.h>  
  #include   <stdio.h> 
    
  void errmsg (char *format, ... )  
  {  
     va_list arglist;  
     ConsolePrintf ("Error: ");  
     va_start (arglist, format);  
     vcprintf (format, arglist);  
     va_end (arglist);  
  }