fork download
  1. #include <iostream>
  2.  
  3. int i = 42;
  4.  
  5. void Func(int& num = i)
  6. {
  7. std::cout << "Func: " << num << '\n';
  8. }
  9.  
  10. int main()
  11. {
  12. int num = 390;
  13. Func(num);
  14. Func();
  15. return 0;
  16. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
Func: 390
Func: 42