- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You must pass NULL (zero by value) for the omitted arguments.
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Steve

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page