0

How to link a void method to a name?

class Program { static void Sqr(int x) { x = 4; x = x * x; Console.WriteLine(x); } static void NewLink(int x){} static void Main(string[] args) { int a= 2; NewLink= Sqr(a); //<——- how to link? NewLink(); //<——- so I dont have to type all arguments. } } Is there a way u can call methods by simply linking them to a name (or something)so u dont have to type all arguments?

2nd Dec 2018, 10:06 AM
Mike Willems
Mike Willems - avatar
2 Answers
+ 1
I believe this does what your looking for: https://code.sololearn.com/clrXkvSwGJ2A
3rd Dec 2018, 5:25 AM
John Wells
John Wells - avatar
+ 1
thx man!
3rd Dec 2018, 12:53 PM
Mike Willems
Mike Willems - avatar