- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
How can i write a funtion in fortran which takes both input and output as arguments.
ex: fun(integer input,integer output)
I want to make use of output value. Currently I am doint the same but the output variable is not holding the value.
I am calling a C funtion from fortran which take input and output as parameters I am able to pass input values succussfully but output is not holding its value.
How can i write a funtion in fortran which takes both input and output as arguments.
ex: fun(integer input,integer output)
I want to make use of output value. Currently I am doint the same but the output variable is not holding the value.
I am calling a C funtion from fortran which take input and output as parameters I am able to pass input values succussfully but output is not holding its value.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As you would expect, plain VALUE attribute works only with INTENT(IN). Without VALUE, the correspondence on the C++ side is by reference or C pointer. c_ptr also could be used to pass data from C to Fortran. In case I have totally mis-guessed your intentions, and textbook examples don't fit your usage, your own example could be useful.
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