Hello,
I have tried this out and i am getting right result.
The code is
class Class1
{
[STAThread]
static void Main(string[] args)
{
Hashtable hash=new Hashtable();
Pixels p=new Pixels( );
p.buf[1,1]=0;
p.buf[2,2]=1;
hash[5]=p;
Pixels p2=hash[5] as Pixels;
Console.Write( p2.buf[1,1] + " " + p2.buf[2,2]);
}
}
class Pixels
{
public int[,] buf=new int[5,5];
}
"bi************@gmail.com" wrote:
Dear Coders:
I have a hashtable,
Hashtable hash=new Hashtable();
and have a class, Pixels
class Pixels
{
public int[,] buf=new int[5,5];
..
..
..
}
when I set this
Pixels p=new Pixels;
p.buf[1,1]=0;
p.buf[2,2]=1;
hash[5]=p;
Pixels p2=hash[5];
!!! now all items of buf[,] are set to 1