fork download
  1. #include <iostream>
  2.  
  3. struct s {
  4. static int const default_a = 1337;
  5. static int const default_b = 4096;
  6. s(int a = default_a, int b = default_b)
  7. : a(a), b(b)
  8. {
  9. std::cout << a << " " << b << "\n";
  10. }
  11. int a;
  12. int b;
  13. };
  14.  
  15. int main() {
  16. s x;
  17. s y(42);
  18. s z(s::default_a, 42);
  19. return 0;
  20. }
  21.  
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
1337 4096
42 4096
1337 42