I am pretty sure this is meaningless:
Also, you do *not* need to allocate more memory to temp; it points to the allocated memory in array. You actually *cannot*, look:
Code:
temp = array;
temp = malloc(xx);
This would be pointless; either it points to array, or it points to it's own block of memory, not both. The second line reassigns temp -- it will no longer point the value of it's previous assignment.
You are going about this the wrong way by trying to affect a change on the level of the array pointer. You will have to implement the difference between the datatypes when looping thru the array, ie, on the level of the individual element.