jamescpp

Untitled

Nov 7th, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1. #include<iostream>
  2.  
  3. class:public std::ostream{}debug;
  4. #ifndef DEBUG
  5.     #undef DEBUG
  6.     #define DEBUG debug
  7. #endif
  8.  
  9.  
  10. /**
  11.  * ked to prelozis bez -DDEBUG tak sa nic nevipisuje, vhodne napriklad na odovzdanie
  12.  * ked to prelozis s -DDEBUG=std::cerr loguje na cerror
  13.  * ked to prelozis s -DDEBUG=std::cout loguje na cout
  14.  *
  15.  * g++ main.cc -DDEBUG=std::cout -o debugovaciaBinarka
  16.  *
  17.  */
  18.  
  19.  /** v kode */
  20.  int a=5;
  21.  std::string b="ahoj svet";
  22.  DDEBUG << "Klasicke logovanie ako vypis na cout, vsetko funguje cislo:"<<a<<" string"<<b<<std::endl;
Advertisement
Add Comment
Please, Sign In to add comment