home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / PROGRAMM / SERIAL.ZIP / ANSICPP.CPP < prev    next >
C/C++ Source or Header  |  1992-01-29  |  633b  |  29 lines

  1. /********************************************************************
  2. * ansicpp.cpp - ANSI C++ Routines                                   *
  3. *               Copyright (c) 1992 By Mark D. Goodwin               *
  4. ********************************************************************/
  5. #include <stdio.h>
  6. #include <stdlib.h>
  7. #include <stdarg.h>
  8. #include "sercpp.h"
  9.  
  10. int ANSI::printf(char *f, ...)
  11. {
  12.     int l;
  13.     va_list m;
  14.     char *b, *s;
  15.  
  16.     if ((b = (char *)malloc(1024)) == NULL)
  17.         return -1;
  18.     va_start(m, f);
  19.     l = vsprintf(b, f, m);
  20.     s = b;
  21.     while (*s) {
  22.         ansiout(*s);
  23.         s++;
  24.     }
  25.     va_end(m);
  26.     free(b);
  27.     return l;
  28. }
  29.