How to write printf(...) like function

Cris central_p at hotmail.com
Wed Mar 8 14:25:59 PST 2006


     Where is what I'm trying to do is to make a print function that outputs both 
to a console and to a file but I have get a std.format runtime error. Any ideas 
how to do it?


     void printTo(...)
     {
         char[] string;

         void putc(dchar c)
         {
             string ~= c;
         }

         std.format.doFormat(&putc, _arguments, _argptr);

             printf(string ~= "\0"); //  std.c.stdio
             file.printf(string);
     }



More information about the Digitalmars-d-learn mailing list