how do I use ref types in managed c++

  • Thread starter Thread starter alexl
  • Start date Start date
A

alexl

hi,

how can I do this in managed c++

Int32 q = new Int32();
test(ref q);
Console.WriteLine("test: q: {0}",q); <== q shows 5

static void test(ref int p)
{
p = 5;
}


thx
 
To avoid confusion, you might not want to refer to passing by ref as "ref
types". The choice of keywords by Microsoft is unfortunate, but passing by
ref vs by value and reference types vs value types are two totally
independent issues.
--
http://www.tangiblesoftwaresolutions.com
C++ to C#
C++ to VB
C++ to Java
VB & C# to Java
Java to VB & C#
Instant C#: VB to C#
Instant VB: C# to VB
Instant C++: VB, C#, or Java to C++
 
Back
Top