Search This Blog

13 April, 2011

stackalloc keywork of C#.

Program of C# using stactalloc keyword.

class psp
{
public static void Main()
{
unsafe 
{
int *p;
int e;
p=&e;
*p=50;
System.Console.WriteLine(e);
int *j=stackalloc int[5];
//j=new int[5];
//j=stackalloc int[4];
}
}
}


------------------------------------------------------

namespace ...C# Example.

An Example of ~ namespace in C#.

namespace software
{
namespace accounts
{
class Customer
{
}
}
namespace inventory
{
class Item
{
}
class Customer
{
}
}
}
class psp
{
public static void Main()
{
software.accounts.Customer c;
c=new software.accounts.Customer();
}
}
---------------------------------------------------------------------------------

Meetme@