I need my function to return an array, but it doesn't take an array as argument as most of search examples show.
The code is like this:
double myfunction ()
{
double arr[10];
//assign values to the array
return arr;
}
main()
{
double arr2[10];
arr2[10] = myfunction;
//print arr2
}
When I used pointers to display the array, I got values like "CCCCCC"...
std::arrayorstd::vectorwill give you behaviour like that though, but make sure you know how the raw arrays work as well. See this question: stackoverflow.com/questions/4810664/how-do-i-use-arrays-in-cdouble[10]is not implicitly convertible todoublein the same way thatdouble(*)()is not implicitly convertible todouble(which is an out-of-bounds access btw). Please show the real code.