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: 
Martijn is absolutely correct, to piggyback and complete the answer

```
Integer.toBinaryString(sum);

```

would give your output in binary as per the OP question.
```
Try this, tested with binary and decimal and its self explanatory

public String add(String s1, String s2, int radix){
        int s1Length = s1.length();
        int s2Length = s2.length();
        int reminder = 0;
        int carry = 0;
        StringBuilder result = new StringBuilder();
        int i = s1Length -1;
        int j = s2Length -1;
        while (i >=0 && j>=0) {
            int operand1 = Integer.valueOf(s1.charAt(i)+"");
            int operand2 = Integer.valueOf(s2.charAt(j)+"");
            reminder = (operand1+operand2+carry) % radix;
            carry = (operand1+operand2+carry) / radix;
            result.append(reminder);
            i--;j--;
        }
        while(i>=0){
            int operand1 = Integer.valueOf(s1.charAt(i)+"");
            reminder = (operand1+carry) % radix;
            carry = (operand1+carry) / radix;
            result.append(reminder);
            i--;
        }
        while(j>=0){
            int operand1 = Integer.valueOf(s2.charAt(j)+"");
            reminder = (operand1+carry) % radix;
            carry = (operand1+carry) / radix;
            result.append(reminder);
            j--;
        }
        return result.reverse().toString();
    }
}

```