Software Archive
Read-only legacy content
17060 Discussions

Mixed Language Programming and Optional Arguments

multivac
Beginner
636 Views
I have a library of mixed C and FORTRAN routines. Some of the FORTRAN routines have optional arguments. How can I call one of thse routines from a C routine? I have no trouble calling a FORTRAN routine from a C routine when I do not use optional arguments. With optional arguments I get a access violation when I use an optional argument.
0 Kudos
3 Replies
Steven_L_Intel1
Employee
636 Views
You must pass NULL (zero by value) for the omitted arguments.

Steve
0 Kudos
multivac
Beginner
636 Views
That will not work for me. I have a 'C' main program. The FORTRAN routine with the optional arguements is called by the 'C' mail program. Even when the optional argument is included with a real argument or a NULL, I get an access violation. I believe I have a compiler switch/ prototype definition problem. I could send you the program and project file to look at ...
0 Kudos
Steven_L_Intel1
Employee
636 Views
Do you declare the argument as having the OPTIONAL attribute and do you use PRESENT to test for it? Passing NULL should work then. If you need more help, send details to vf-support@compaq.com

Steve
0 Kudos
Reply