Advertisement
iamakulov

Untitled

Apr 1st, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.57 KB | None | 0 0
  1. void print(const char *line, ...)
  2. {
  3.     va_list args;
  4.  
  5.     if (!outputFile)
  6.         outputFile = fopen(OUTPUT_FILE_NAME, "wt");
  7.  
  8.     va_start(args, line);
  9.  
  10.     vprintf(line, args);
  11.     vfprintf(outputFile, line, args);
  12.     fflush(outputFile);
  13.  
  14.     va_end(args);
  15. }
  16.  
  17. void fprint(FILE *stream, const char *line, ...)
  18. {
  19.     va_list args;
  20.  
  21.     if (!outputFile)
  22.         outputFile = fopen(OUTPUT_FILE_NAME, "wt");
  23.  
  24.     va_start(args, line);
  25.  
  26.     vfprintf(stream, line, args);
  27.     vfprintf(outputFile, line, args);
  28.     fflush(outputFile);
  29.  
  30.     va_end(args);
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement