I'm trying to convert an int array to a float array but I'm not quite sure how. Currently I have it so "out" gets the array value too, but this is what is making it not compile. If I remove the [i] from out, it will just use the last value from the int.
Code:
void int2float(const int[] array, int count) {
float out;
for (int i = 0; i < count; i++)
{
out[i] = float(array[i]);
}
return out;
}
Also is there any reason why you cant use sizeof in a for loop like so?
Code:
for (int i = 0; i < sizeof(array); i++)
Edit: Found out why it didn't work, forgot to specify the size of out. Now I get a warning on "return out" with a tag mismatch, yet its not mismatched? Should I just ignore it?