Bull DPX/20 Uživatelská příručka Strana 50

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 424
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 49
1-38 SOMobjects Base Toolkit: Programmers Reference Manual
somVprintf Function
Purpose
Prints a formatted string in the manner of the C vprintf function.
Syntax
long somVprintf (string fmt, va_list ap);
Description
The somVprintf function prints a formatted string using SOMOutCharRoutine, in the same
manner as the C vprintf function. The implementation of SOMOutCharRoutine determines
the destination of the output, while the C printf function is always directed to stdout. (The
default output destination for SOMOutCharRoutine is stdout also, but this can be modified
by the user.)
Parameters
fmt The format string to be output.
ap A va_list representing the values to be substituted into the format string.
Return Value
Returns the number of characters written.
C Example
#include <som.h>
main()
{
va_list args = (va_list) SOMCalloc(20);
va_list push = args;
float f = 3.1415
char c = ’a’;
va_arg(push, int) = 1;
va_arg(push, double) = f; /* note ANSI widening */
va_arg(push, int) = c; /* here, too */
va_arg(push, char*) = ”this is a test”;
somVprintf(”%d, %f, %c, %s\n”, args);
}
Related Information
Functions: somPrintf, somPrefixLevel, somLPrintf, SOMOutCharRoutine
Data Structures: string (somcorba.h), va_list (stdarg.h)
Zobrazit stránku 49
1 2 ... 45 46 47 48 49 50 51 52 53 54 55 ... 423 424

Komentáře k této Příručce

Žádné komentáře