home *** CD-ROM | disk | FTP | other *** search
/ Resource for Source: C/C++ / Resource for Source - C-C++.iso / codelib9 / v_11_01 / 1101108a < prev    next >
Encoding:
Text File  |  1995-11-01  |  408 b   |  26 lines

  1. #include <stdarg.h>
  2.  
  3. char *PrintString(const char *fmt, ...)
  4. /* Convert printf() arguments into a static string. */
  5. {
  6.     va_list   args;
  7.     static char line[999];
  8.  
  9.     va_start(args, fmt);
  10.     vsprintf(line, fmt, args);
  11.     va_end(args);
  12.     return line;
  13.  
  14. }
  15.  
  16. void Msg(const char *fmt, ...)
  17. /* Send message to stdout user. */
  18. {
  19.     char   *line;
  20.  
  21.     line = PrintString(fmt);
  22.     print("%s\n", line);
  23.     ...
  24. }
  25.  
  26.