using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SoloLearn
{
class Program
{
static void YourMethod(ref int m)
{
m = m * m;
}
static void Main(string[] args)
{
int number = 5;
YourMethod(ref number); // Now the "number" variable has affected
Console.WriteLine(number); //output will be 25. NOT 5.
Console.ReadKey();
}
}
}
Hiç yorum yok:
Yorum Gönder