hi

how do i do this problem

how do i put this in to an array

 p.assign(p1, A);
            p.assign(p1, B);
            p.assign(p2, _A);
            p.assign(p2, _B);

so that it display as

p1 A B
p2 _A _B

because everytim i call the assign method the array index are going to be 0,0 how do i make it reference to the first variable

thanks
as in
in side the class
Proxy p = new Proxy();
p1 & p2 = instance of processor and
A B _ & _B = instnce of track amanger

please send your assign method code it needs to be chnaged so that based on P size and availablity it assigns to right index

{int  x=0,  y = 0;

        private Processor[ ] processArray;
        private TrackManager[] trackManagerArray;

        public Proxy()
        {
            processArray = new Processor[4];
            trackManagerArray = new TrackManager[4];


        }
        public void  setIndexX( int X)
        {
           this.x = X;
        }
         public void  setIndexY( int Y)
        {
           this.y = Y;
        }
         public int getX()
         {
             return x;
         }
         public int getY()
         {
             return y;
         }
        public void assign(Processor p1, TrackManager A)
        {
            int x1 = getX();
            int y1 = getY();

            Console.WriteLine(x1);
            Console.WriteLine(y1);

            processArray[x1] = p1;
            trackManagerArray[y1] = A;

            setIndexX(x1+1);
                setIndexY(y1+1);
        }
        }

there should be a better way that what i am doing

This article has been dead for over six months. Start a new discussion instead.