I know it is inefficient to return an array by value instead of with a pointer. However, my CS class final has a requirement that a function is to return a 5 digit 1D array as a value. As such, I can not return the array by pointer. I am also unable to have any global variables.
I have tried
float FunctionName(){
float myVar[5];
//process data
return myVar;
}
I have also tried
float[] FunctionName(){
float myVar[5];
//process data
return myVar;
}
I even tried tricking the compiler with
float FunctionName(float myVar[5]) {
//process data
return myVar;
}
I have read that it is impossible, but I am guessing it is just really weird or hard to do. I think it might be possible with an enum type, but I am unsure how I would set that up.