I want to make a subroutine like the READ statement. By that I mean, I want to be able to use any number of parameters, and have them be of any type. The function will eventually call a c function which will be emulating the fortran READ statement, but will be getting the data from a C data structure.
So I was wondering if it is possible to make a fortran function that I could use like this:
CREAD (1, '(%i,%i,%d,%c,%d)', int1, int2, double1, char1, double2)
and then use the same subroutine like:
CREAD (1, '(%c,%i,%d,%d)', char2, int1, double1, double2)
If this can be done, could someone point me in the right direction for some documentation on it?
The statement I'm after is similar to the use of ellipses in c function signatures.