Skip to content

Latest commit

 

History

History
30 lines (20 loc) · 561 Bytes

File metadata and controls

30 lines (20 loc) · 561 Bytes

out

تستخدم لإرسال البيانات باستخدام المرجع " reference "

  • لا تشترط حفظ قيمة مسيقة للعنصر المرسل
  • لكن تشترط وجود قيمة له قبل الخروج من الدالة

مثال

        public static void Main()
        {

            int x ;
            useout(out x);
            Console.WriteLine(x); // x = 11

        }

        static int useout(out int x)
        {

            x = 9 + 2;
            return x;
        }