Passing value without reference in C#
Passing value without reference in C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MYPROJECT.startup
{
class startupday1
{
static void Main()
{
int y = 0;
func( y);
Console.Write("new value is {0}\n", y);
Console.Write("new value is {0}\n", func(y));
Console.ReadKey();
}
static int func( int x)
{
x = 10;
return x;
}
}
}
OUTPUT
Comments
Post a Comment