SHARE
TWEET

Untitled

a guest Oct 12th, 2017 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <cstdio>
  2. #include <cstring>
  3. #include <string>
  4. #include "unistd.h"
  5.  
  6. #ifndef _BUF_SZ__
  7. #define _BUF_SZ__ 1 << 16
  8. #endif
  9.  
  10. int main(int argc, char *argv[]) {
  11.     const char *val(argc > 1 ? argv[1]: "y");
  12.     std::string data;
  13.     while(data.size() + std::strlen(val) + 1 <= _BUF_SZ__) data += val, data += '\n';
  14.     while(write(STDOUT_FILENO, data.data(), data.size()));
  15.     return EXIT_FAILURE;
  16. }
RAW Paste Data
Top