fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. const int foo = 5;
  5.  
  6. class Foo {
  7. public:
  8. int sum(int x, int y=foo) {
  9. return x + y;
  10. }
  11. };
  12.  
  13. int main() {
  14. Foo f;
  15. cout << f.sum(5);
  16. return 0;
  17. }
Success #stdin #stdout 0s 3096KB
stdin
Standard input is empty
stdout
10