I know this question has been asked before but cannot find it in the same manner as I will describe it here:
Its all about returning an one-dimensional array in c-language. In java its very easy:
double[] myFunction() {
double[] v = new double[10];
return v;
}
I know that the implementation in c is not the same. But as an array element can be considered as a pointer to the first element in that array I thought one could do the following implementation:
double (*myFunction()) {
double v[10];
return v;
}
This compiles fine in gcc but when I make a call of the function I get a compilation error.
SO my Question - how does one return a one-dimensional vector in c-language?
Thanks