Custom Printf function


/ Published in: C++
Save to your folder(s)

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


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.