Posted By

FACastello on 11/08/10


Tagged

print message printf


Versions (?)

Custom Printf function


 / Published in: C++
 

This is a custom implementation of printf. You can expand this function to do whatever else you want it to do.

  1. #include <stdio.h>
  2. #include <stdarg.h>
  3.  
  4. void pline(char* str, ...)
  5. {
  6. char buf[256];
  7. va_list args;
  8.  
  9. va_start(args, str);
  10. vsprintf(buf, str, args);
  11. va_end(args);
  12.  
  13. printf(buf);
  14. }

Report this snippet  

You need to login to post a comment.