Pass valuel by pointer : Function Parameters : Language Basics C# Source Code


Custom Search

C# Source Code » Language Basics » Function Parameters »

 

Pass valuel by pointer








    
 
using System;

public class Starter {
    public unsafe static void Main() {
        int val = 5;
        int* pA = &val;
        int* pB;
        pB = MethodA(pA);
        Console.WriteLine("*pA = {0} | *pB = {0}", *pA, *pB);
    }

    public unsafe static int* MethodA(int* pArg) {
        *pArg += 15;
        return pArg;
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Language Basics
» Function Parameters