Square array elements using pointers