무명함수2 [C#]식트리 식트리란? 식을 트리로 표현한 자료구조 using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Text; using System.Threading.Tasks; namespace ConsoleApp16 { class Program { static void Main(string[] args) { /* 식트리 */ //1*2+(x-y) Expression const1 = Expression.Constant(1); Expression const2 = Expression.Constant(2); Expression leftExp = Expression.Multiply(con.. 2020. 6. 15. [C#]람다식(Func대리자) 람다식이란? 익명 메소드를 만듦 매개변수목록 => 식 원래 () () = delegate (int a, int b) { return a + b; }; 변경>>> () ()= (int a, int b)=>a+b; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApp16 { class Program { /*더 간편하게 무명함수 만들기 Func대리자*/ static void Main(string[] args) { Func func1 = () => 10; //입력 매개변수가 없으며, 무조건 10을 반환 Console.Wri.. 2020. 6. 15. 이전 1 다음