KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
The below does not compile: Func<int, int> fac = n => (n <= 1) ? 1 : n * fac(n - 1); Local variable 'fac' might not be initialized before accessing How can you make a recursive function with lambdas? [Update] Here are also two links that I found interesting to read: Eric Lippert's "Why does a recursive lambda cause a definite assignment error?" Anonymous Recursion in C#
Tags (comma-separated)
Save Edits
Cancel