摘要
多语言的混合编程主要是一种语言编写的程序对另一种语言编写的例程实施调用,所用到的数据主要通过例程参数来传递,当中很少体现出面向对象的程序设计思想.现提出利用Fortran 90新引进的模块,实现Fortran与C/C++面向对象的混合编程新模式.示例结果表明,C/C++既可直接访问For-tran模块中的数据和例程;其自身的数据和函数也可封装到模块中,供引用模块的Fortran程序单元访问.
In mixed -language programming, routines programmed with one language are called with the other, and the data passed through calling argument lists, so no object- oriented programming is embodied in this process. In this paper, based on the module recommended by Fortran 90, a new way of object - oriented mixed- language programming with the two languages is presented. It has been proved from the experiment that not only C/C ++ is able to directly access the data and routines in the module, but also C/C ++ data and routines to be encapsulated into the module in order to be accessed by the Fortran unit using the module.
出处
《郑州大学学报(工学版)》
CAS
2008年第1期99-101,109,共4页
Journal of Zhengzhou University(Engineering Science)
基金
河南省科技攻关项目(0496050905)
关键词
数值计算
混合编程
调用约定
面向对象
模块
numerical computation
mixed - language programming
calling convention
object - oriented
module