News for hackers. Stuff that matters.
Re:Baby's First Garbage Collector by MaulingMonkey on Sunday December 08, 2013 @11:36PM (#6872832)
Sure am.

  using System;
  
  namespace Test2012
  {
  	unsafe class C  { public byte* P; public override string ToString( ) { return new IntPtr(P).ToString( ); } }
  	unsafe struct S { public byte* P; public override string ToString( ) { return new IntPtr(P).ToString( ); } }
  
  	static class Program
  	{
  		static unsafe void Main( )
  		{
  			fixed( byte* test = new byte[] { 1, 2, 3 } )
  			{
  				var c = new C( ) { P = test };
  				var s = new S( ) { P = test };
  				Console.WriteLine( "Test: {0}", c );
  				Console.WriteLine( "Test: {0}", s );
  			}
  		}
  	}
  }
Result:

  Test: 40510364
  Test: 40510364
  Press any key to continue . . .

There are no comments on this comment yet.