Question: I'm porting some C++ code to Actionscript 3 and just had a small question I'm confused about.

In one function, one of the parameters is `int* myPtr`. myPtr is the address of an element of a 2D-Array, `&my2DArray[x][y]`. x and y are also parameters of the function. I'm just a little bit confused with what is being accessed when the code accesses, for example, `myPtr[1]`. I think this would be the next element in `my2dArray`, but I'm not sure if this would be `my2DArray[x+1][y]` or `my2DArray[x][y+1]`. Thanks for any help.

Additional info:
my2DArray is created by: 

```
//initPtr is a int*, auxPtr is a int*, as is temp1
initPtr = (unsigned int *)NewPtr(
      sizeof(unsigned int) *
      X * Y);
  }

  auxPtr = initPtr ;

  for (i = 0; i < X; i++) {
    temp1 = auxPtr + i * Y;
    my2DArray[i] = (short *)temp1;
  } 

unsigned char* NewPtr(
  int size)
{
  return ((unsigned char*)calloc(size, sizeof(unsigned char)));
}

```

Answer: 
```
package Assignment19thDec;

import java.util.Scanner;

public class addTwoBinaryNumbers {

    private static Scanner sc;

    public static void main(String[] args) {

        sc = new Scanner(System.in);
        System.out.println("Enter 1st Binary Number");
        int number1=sc.nextInt();
        int reminder1=0;
        int number2=sc.nextInt();
        int reminder2=0;
        int carry=0;
        double sumResult=0 ;int add = 0
        ;
        int n;
        int power=0;
        while (number1>0 || number2>0) {

            /*System.out.println(number1 + " " +number2);*/

            reminder1=number1%10;
            number1=number1/10;
            reminder2=number2%10;
            number2=number2/10;
            /*System.out.println(reminder1 +"  "+ reminder2);*/

            if(reminder1>1 || reminder2>1 ) {
                System.out.println("not a binary number");
                System.exit(0);
            }

            n=reminder1+reminder2+carry;
            switch(n) {

            case 0: 
                    add=0; carry=0;                                 
                    break;                  
            case 1: add=1; carry=0;
                    break;
            case 2: add=0; carry=1;
                    break;
            case 3: add=1;carry=1;
                    break;
            default: System.out.println("not a binary number ");

            }

            sumResult=add*(Math.pow(10, power))+sumResult;
            power++;

        }

        sumResult=carry*(Math.pow(10, power))+sumResult;
        System.out.println("\n"+(int)sumResult);

    }

}

```
here's a python version that

```
def binAdd(s1, s2):
    if not s1 or not s2:
        return ''

    maxlen = max(len(s1), len(s2))

    s1 = s1.zfill(maxlen)
    s2 = s2.zfill(maxlen)

    result  = ''
    carry   = 0

    i = maxlen - 1
    while(i >= 0):
        s = int(s1[i]) + int(s2[i])
        if s == 2: #1+1
            if carry == 0:
                carry = 1
                result = "%s%s" % (result, '0')
            else:
                result = "%s%s" % (result, '1')
        elif s == 1: # 1+0
            if carry == 1:
                result = "%s%s" % (result, '0')
            else:
                result = "%s%s" % (result, '1')
        else: # 0+0
            if carry == 1:
                result = "%s%s" % (result, '1')
                carry = 0   
            else:
                result = "%s%s" % (result, '0') 

        i = i - 1;

    if carry>0:
        result = "%s%s" % (result, '1')
    return result[::-1]

```