从C ++调用Fortran [英] call from C++ to Fortran

查看:115
本文介绍了从C ++调用Fortran的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用Fortran编写的程序,我想成为C ++中的主要部分,并且C ++的调用和函数运行程序运行良好。

解决方案

怎么样 Google [ ^ ]?


要从C ++调用FORTRAN中的方法,您需要将FORTRAN方法声明为extern in C ++代码。然后在C ++代码中按名称调用FORTRAN方法。必要时,必须小心使用用作FORTRAN方法参数的变量的地址。阅读以下链接中的示例以了解如何执行此操作。 此处 [ ^ ]是一个快速示例。 这个 [ ^ ]是一个很好的参考。

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.

解决方案

What about Google[^]?


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.


这篇关于从C ++调用Fortran的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆