HELP ME! PLEASE,
I'm programming in C/C++, but now I'm programming in F90
There is a way, for I declare a function generic : G
>>aproach:
module mGENERIC
TYPE Generic
interface
function G(x) ! generic function
integer :: G,x
end function
end interface
END TYPE Generic
TYPE(Generic) :: XXXX
contains
function F(x) ! current function
integer :: x,F
F = x*x
end function
end module mGENERIC
program proof
use mGENERIC
XXX% G = F
(XXX%G)(10) ! == F(10)
end program proof
Please, There is equivalence in f90 with:
int func(int i)
{ return i*i;}
main()
{
int (*f)(int);
f = func;
f(10); /* == func(10); */
}
Very Thanks!!
______________________________________________________________________________
|\\/\/\/\/\/| _____________ |
| | / \ | Miguel Murillo
| | | Elvis is | | [log in to unmask]
| __ __ | | dead ! | | Voice: +34-976-761000 ext. 5052
| | | | | | | | | Fax: +34-976-761882
C\ |0 | |0 | /O | bart. | |
| "" _ "" | \_ __________/ | Laboratorio de Investigacion en
| | // | TEcnologias de la Combustion (CSIC)
\'-----'/ --' |
_____/-----\_____ | Computer:bart.cps.unizar.es
/ | | \ | (155.210.32.114)
____________________________________|_________________________________________
Linux: The choice of a GNU generation
"My opinions are my own, and I've get *lots* of them!"
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|