Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
ref variables/parameters
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { static void changeValue(ref int n) // directly access the memory location of passed variable as parameter n with 'ref' keyword { n = n * n; // value of variable 'a' in Main method updated directly, hence it doesn't need to be returned } public static void Main(string[] args) { int a; a=10; changeValue(ref a); // pass memory location (address) of variable a using 'ref' keyword //notice that the changeValue() return type is void, but still it affects the original variable's value Console.WriteLine("After changes : " + a); } } }
run
|
edit
|
history
|
help
0
Use ConcurrentQueue and ConcurrentDictionary with TPL (Simple example)
a.k.java
sdfgthyjuiujy7htgrf
Математика
ICollection<T>.Add(T) - Performance Test
Problem: fb_series
salary
Sorting Square Problem
Write a program to sort given array using bubble sort.
D18