View Single Post
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 07-26-2017 , 18:13   Re: int array to float array from function
Reply With Quote #7

Quote:
Originally Posted by Neuro Toxin View Post
Code:
stock float[] int2float(const int[] array, int count)
{
	float[] out = new float[count];
	for (int i = 0; i < count; i++)
	{
		out[i] = float(array[i]);
	}
	return out;
}
You can't return a dynamic array. Sizes of destination and output arrays have to be known at compile-time, and the destination array has to be equal or greater in size than the output array.

Last edited by klippy; 07-26-2017 at 18:17.
klippy is offline