Click here to Skip to main content
15,891,633 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a program written in Fortran and I want to be the main part only in C++ and calls and functions of C++ to run the program performs well.
Posted
Updated 13-Dec-13 2:09am
v2
Comments
nv3 13-Dec-13 7:06am    
Please be a little patient. Just because there is no answer in 10 min is no reason to re-post your question. Please delete one of your two questions and put the additional information into a single one by using the green "Improve question" link.

What about Google[^]?
 
Share this answer
 
To call a method in FORTRAN from C++ you need to declare the FORTRAN method as extern in the C++ code. Then call the FORTRAN method by name in the C++ code. You must be careful to use the address of variables used as parameters to the FORTRAN method, when required. Read the examples in the following links to understand how to do this. Here[^] is a quick example. This [^]is a good reference.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900