readme

来自「书籍《JAVA面向对象程序设计》书籍的课后源代码。相信对很多人都有帮助」· 代码 · 共 36 行

TXT
36
字号
This directory demonstrates that you can link
f77 programs into Java through C.  Here
Java calls the C function in myAverage.c which calls
the subroutine avef77() in ave.f

On HP-UX: 

(1) compile C file with:

cc -Ae +z -c -I/opt/java/include -I/opt/java/include/hp-ux myAverage.c

producing myAverage.o

(2) compile f77 file with:

f77 +z -c ave.f

producing ave.o

(3) Now build shared lib with

ld -b ave.o myAverage.o -o libave.sl

(4) javac Average.java

(5) java Average

You'll get the result

In C code
i is 11 and j is 20
Average is 15.500000



⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?