stdalloc Keyword Use C# with Example



stdalloc Keyword Use C# with Example

 	using System;

	namespace CSharpClass
	{
		public struct Coordinate
		{
			public int x, y;
		}
		
		class UsingPointers
		{
			unsafe static void UnsafeStackAlloc()
			{
				char* p = stackalloc char[256];
				for (int k = 65; k < 91; k++)
					p[k] = (char)k;
					
				for (int k = 65; k < 91; k++)
					Console.Write(p[k] + "    ");
			}

			static void Main()
			{
				unsafe
				{
					UnsafeStackAlloc();
				}
			}
		}
	} 

0 Comment's

Comment Form

Submit Comment