DEV Community

Debjoty Mitra
Debjoty Mitra

Posted on

Lambda Function in C++

These three lines of code will help to understand how lambda functions work in c++:

int sum = [](int x, int y){return x+y;}(10,20);
// or
auto sumFunc = [](int x, int y){return x+y;};
int sum = sumFunc(10,20);
Enter fullscreen mode Exit fullscreen mode

Top comments (0)