   variable argument list
  Hi,I wanted to know if there was an equivalent with the STL.For example, instead of include stdio.h and stdlib.h, and using fopen() and fprintf(), I now include fstream, and use ofstream and operator <<.Is there an equivalent with variable argument list, or should I still use stdarg.h, va_list, va_start, etc. ??   
  I don't quite understand your question, what is it going to be used for?C variable argument lists can only be used on POD-types in C++, there are various methods of simluating NON-POD type compatible variadic functions:Do as the iostreams do, overload some binary operator, make it a cascading function, if it makes sense or possible do buffering to increase preformance/efficiencyif buffering does not make sense or possible, then another alternative very similar to the previous one is using expression templates or there younger little brother Composition/Compositor objects (a term coined by Bjarne Stroustrup).Use boost.preprocessor and generate N overloadeds for a particular template function where N can be user-configurable.;  thx for the reply.Guess I wasn't clear ^^ I wanted to know if I can replace that kind of code :void aFunction(char *text, ...){   char*msg;   int len;   va_list  ap;   va_start(ap, text);   len = _vscprintf(text, ap);   msg = new char [len + 1];   _vsnprintf(msg, len, text, ap);   va_end(ap);   msg[len] = '\0';}by something likevoid aFunction(char *text, ...){   std::string  msg;   msg << text;   // or something like :   std::va_arg args(text);   args.format();   msg << args;}In fact, I'm just looking for a simpler / safer way of handling variable argument lists. As std::string now replace all the char *, strcpy, etc. in my code, I wanted to find something to replace all my va_list, etc. ^^   ;Quote:Original post by paicI'm just looking for a simplerThe simplest way is to use string streams for that, there just like file streams and any stream type except there for strings in memory of-course [wink]. There are in header sstream and if you are still hampering for format strings well that is still possible with C++ iostreams check here.   