shadowm

Untitled

Nov 3rd, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | None | 0 0
  1. // Tab indentation
  2.  
  3. namespace ns
  4. {
  5. class A
  6. {
  7. public:
  8.     A();
  9.     ~A();
  10.  
  11.     const std::string& format(int foo, const std::vector<std::string>& bar) const;
  12.  
  13. private:
  14.     int v_;
  15.     bool w_;
  16.  
  17.     void do_stuff();
  18. }; // A
  19.  
  20. struct B
  21. {
  22.     B();
  23.  
  24.     int v;
  25.     bool w;
  26. }; // B
  27.  
  28. int foo()
  29. {
  30. }
  31.  
  32. } // end namespace ns
  33.  
  34. const char* bar(bool bat)
  35. {
  36.     if(bat) {
  37.         bag();
  38.     } else {
  39.         bam();
  40.     }
  41.  
  42.     const char* res = NULL;
  43.  
  44.     switch(foo()) {
  45.         case 1:
  46.             res = "1";
  47.             break;
  48.         default:
  49.             res = "0";
  50.     }
  51.  
  52.     while(*res) {
  53.         ++res;
  54.     }
  55.  
  56.     res = "42";
  57.  
  58.     do {
  59.         ++res;
  60.     } while(*res);
  61.  
  62.     for(unsigned i = 0; i < 42; ++i) {
  63.         *res = 0;
  64.     }
  65.  
  66.     return res;
  67. }
Advertisement
Add Comment
Please, Sign In to add comment