主页
C++
C++ Lambda 函数
demo_lambda_capture2
运行 ❯
×
更改方向
保存代码
更改主题
#include
using namespace std; int main() { int x = 10; auto show = [&x]() { cout << x; }; x = 20; // Change x after the lambda is created show(); return 0; }
20