fork download
  1. #include <iostream>
  2.  
  3. int main()
  4. {
  5. int i = 5;
  6. auto f = [&i](){ i = 42; };
  7. std::cout << i << '\n';
  8. f();
  9. std::cout << i << '\n';
  10. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
5
42