استفاده از delegate به عنوان پارامتر تابع در #C
سلام بر تمامی برنامه نویسان سی شارپ 😉 در این مطلب ، استفاده از delegate به عنوان پارامتر تابع در سی شارپ #C رو براتون آماده کردم. انشاالله که این کد براتون مفید باشه.
خروجی پروژه به این صورت می باشد:
3
استفاده از delegate به عنوان پارامتر تابع :
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;
delegate void FooBar();
public class MainClass
{
static void Invoke3Times(FooBar d)
{
d(); d(); d();
}
public static void Main(){
int i = 0;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;
delegate void FooBar();
public class MainClass
{
static void Invoke3Times(FooBar d)
{
d(); d(); d();
}
public static void Main(){
int i = 0;