namespace cpp {}

C++ lernen, kennen, anwenden

Benutzer-Werkzeuge

Webseiten-Werkzeuge


kennen:lib:vprintf
no way to compare when less than two revisions

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.


kennen:lib:vprintf [2012-04-11 17:24] (aktuell) – angelegt - Externe Bearbeitung 127.0.0.1
Zeile 1: Zeile 1:
 +====== vprintf() ======
 +''#include'' [[..:include:cstdio]]
 +
 +<code cpp>
 +int vprintf (const char *format, va_list ap) 
 +</code>
 + Formatierte Ausgabe wie ''printf()'', jedoch mit variabler Argumentliste.
 +
 +==== Parameter ====
 +| ''format'' | Format-Zeichenkette |
 +| ''ap''     | aktive variable Argumentliste|
 +==== Ergebnis ====
 +Rückgabewert: wie ''printf()''.
 +
 +==== Siehe auch ====
 +[[printf]],
 +[[vfprintf]],
 +[[vsprintf]],
 +[[va_start]],
 +[[va_end]].
 +
 +==== Beispiel ====
 +<code cpp vprintf.cpp>
 +#include <cstdio>
 +#include <cstdarg>
 +using namespace std;
 +
 +int vpf(char *fmt, ...)
 +{
 +  va_list argptr;
 +  va_start(argptr, fmt);
 +  int cnt = vprintf(fmt, argptr);
 +  va_end(argptr);
 +  return(cnt);
 +}
 +
 +int main(void)
 +{
 +  int   i = 30;
 +  float f = 90.0;
 +  char *s = "abc";
 +  vpf("%d %f %s\n", i, f, s);
 +  return 0;
 +}
 +</code>
  
kennen/lib/vprintf.txt · Zuletzt geändert: 2012-04-11 17:24 von 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki