Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Collections;
- using System.Windows;
- namespace CSharpConsoleApp
- {
- class Program
- {
- static void Main()
- {
- int[] a = new int[3] { 1, 2, 3 };
- f(ref a);
- Console.WriteLine(a[0]);
- }
- // REF ilə OUT-un fərqi odur ki, out istifadə olunan dəyişənin inisiallaşdırılmasını(initialize) məcburi tələb etmir, REF isə məcburi tələb edir!
- static void f(ref int[] x)
- {
- x[1] = 532;
- //x = new int[3];
- //x[0] = 9;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment