fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void f (int a, int & b)
  5. {
  6. switch (a) {
  7. case 1: b = 1; break;
  8. case 2:
  9. if (b >= 0)
  10. b = 2;
  11. else // missing break
  12. return;
  13. default: b = 10;
  14. }
  15. }
  16.  
  17. int main() {
  18. int a = 2;
  19. int b = 0;
  20.  
  21. f(a, b);
  22.  
  23. cout << b;
  24. return 0;
  25. }
Success #stdin #stdout 0s 2728KB
stdin
Standard input is empty
stdout
10