```
int* productExceptSelf(int* nums, int size, int* returnSize)
{
int* arr = (int*)malloc(sizeof(int)*size); //the result array;
arr[0] = 1;
for(int i = 1; i < size; i++) //collect the product of left side;
arr[i] = arr[i-1] * nums[i-1];
int t = nums[size-1]; //using t to collect the right side;
for(int i = size-2; i > -1; i--) //merge t and arr, we get the product except self;
{
arr[i] *= t;
t *= nums[i];
}
*returnSize = size;
return arr;
}
```