Can somebody explain me lambda expressions & what they can be used for. I have googled for it & have a rough idea. most of the examples give c# code. How about lambda expressions in plain old C…?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are actually two things called “lambda expressions”, which are rather loosely related:
Lambda expressions are fundamental part of lambda calculus and are closely related to functional programming
In imperative languages, lambda expressions are usually synonyms for anonymous methods. In C#, for example you can pass lambda expression (ie. an expression itself, not just its result) as an argument:
C#:
Having said that, C does not support anonymous methods. You can, however, use function pointers to achieve similar results: