#include
<cstdio>
int sprintf (char *s, const char *format, ...)
Formatierte Ausgabe in den Hauptspeicher ab s
.
s | Adresse des Ausgabezielspeichers |
format | Formatzeichenkette siehe printf(), |
Rückgabewert: wie printf().
#include <cstdio> #include <iostream> int main() { using namespace std; double d = 123.4567; char puffer[20]; sprintf(puffer,"%10.2f", d); cout << puffer << '\n'; }