[post to c and c++ newsgroup]
the above should be possible in C++ (pheraps using instead "%4.4f").
don't remember what is fmt, could be one "stream manipulator"? could be
one class [the call to one constructor of a tmp object]?
don't know. do you know it someone of you?
Is it possible this below?
double a, b;
cout << SPrintf("%2.2f %2.3f", a, b) << "\n";
with SPrintf() one function (stream manipulator?)
ostream& SPrintf(ostream& v, char* fmt, ...)?
that print like printf() in stdout?
Ellipsis cannot be made to work type-safely in C++. Instead, one uses some
kind of operator overloading, which takes care of needed conversions. There
is the boost.format library, the usage looks like:
cout << format("%2.2f %2.3f") % a % b;
hth
Paavo
puke
--
I find the easiest thing to do is to k/f myself and just troll away
-- David Melville on r.a.s.f1
but not used much that "cout << fmt("%4.4f") << v",
now the c++ functions that i write deal with files has prototipe like
int ImDoAll(typstruct* res, type* a, FILE* f1, FILE* f2, FILE* f3);