fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5.  
  6. int main()
  7. {
  8. int c= 5;
  9. int b= 2;
  10.  
  11.  
  12. struct Sub1
  13. {
  14. Sub1(int& c, const int& b):c(c),b(b){};
  15. void operator()(void){c-=b; ++c;}
  16. private:
  17. int &c;
  18. const int &b;
  19. };
  20. Sub1 sub1(c,b);
  21.  
  22. sub1();
  23.  
  24. std::cout << c <<" "<< b <<std::endl;
  25. return 0;
  26. }
Success #stdin #stdout 0s 4168KB
stdin
Standard input is empty
stdout
4 2