I would like to pass an array by reference in a function. I have tried this:
func real myfunc2(real a,real b,real[int] &c(2))
But it does not work. Is there any way to pass an array or matrix by reference in FreeFem++ ?
I’m not sure I understand what you want.
func real myfunc2(real a,real b,real[int] &c)
real a = 10;
real b = 1;
real[int] c(2) ;
real Exec = myfunc2(a,b,c);
cout << c << endl;
Does this code give you what you want?
Yes, it is exactly what I wanted to know. Many thanks for your help.