how to initialize a char array in structure in C# i am doing this
struct cell
{
public char[] domain =new char[16];
public int[] Peers;
public int NumberOfPeers;
public char assignValue;
}
but its giving error that we cannot initialize an array in the body of structure! can any one tell the correct way
You can use a
constructorfor this. Look at MSDN.