Quote:
|
Originally Posted by charliev
Hello all,
With all the questions I've been posting, it's obvious I'm a newbie... thanks for all the help.
I'd like to create a FUNCTION that returns an ARRAY, but not sure of the syntax. I tried this:
double function_name[] (double var1, double var2)
{
// do something to create array here
}
But it didn't like the square brackets.
Also, how do you DECLARE and INIAILIZE a 2 dimentional array?
Thanks for the help!
-charliev
|
charliev,
You
can not return an ARRAY the way you wrote your code:
To return an array use code like this:
PHP Code:
void function_name (double& MyArray[], double var)
{
//Fill MyArray with the elements you want.
//Don't use RETURN keyword
}