Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main ()
- {
- int tab[4]={0,1,2,3};
- auto f= [tab](){
- for (int x: tab)
- cout << x << endl;
- };
- auto g= [&tab](){
- for (int x: tab)
- cout << x << endl;
- };
- for (int i=0;i<4;i++)
- tab[i]=5;
- f();
- cout << endl;
- g();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement