Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

fortran funtions with parameters

cvnravi
Beginner
403 Views
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.
0 Kudos
1 Reply
TimP
Honored Contributor III
403 Views
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.
0 Kudos
Reply