+ 3

"You can define a function inside another function”

In C++ challenges, there is a question "You can define a function inside another function”, of which the right answer would be false. However what about the lambda expressions? They are both definable and callable inside functions.

19th Nov 2021, 7:30 AM
Magnus
Magnus - avatar
3 odpowiedzi
+ 5
I'm guessing that quiz was based on pre C++11 standards. And perhaps the quiz poster was strictly referring to actual function definition. Though by definition your statement that lambda expressions are definable and callable was correct.
19th Nov 2021, 7:42 AM
Ipang
+ 3
Perhaps they should have described they are strictly referring to the normal function definition instead of making the people confused.
19th Nov 2021, 9:00 AM
Magnus
Magnus - avatar
0
yes you can define function inside another function which is also called nested function
23rd Nov 2021, 3:57 AM
Prayanshu Sharma
Prayanshu Sharma - avatar