If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Re: C and Fortran mix programming problem

Originally Posted by taurushong

You are right. '5' is from the value of C. Then I am really confused. Why z=0?

You have a variable in your 'C' program called "z", and you're printing it after assigning it the return value of that function. If that function returns 0, then z is 0. That's the only explanation from the C++ side of things.

Why the function returns 0 is a FORTRAN issue, or an issue with how FORTRAN returns values to a 'C' program, and I have no idea how that works.

Re: C and Fortran mix programming problem

Thank you very much Paul.

Best,
Hong

Originally Posted by Paul McKenzie

You have a variable in your 'C' program called "z", and you're printing it after assigning it the return value of that function. If that function returns 0, then z is 0. That's the only explanation from the C++ side of things.

Why the function returns 0 is a FORTRAN issue, or an issue with how FORTRAN returns values to a 'C' program, and I have no idea how that works.

* The Perfect Platform for Game Developers: Android
Developing rich, high performance Android games from the ground up is a daunting task. Intel has provided Android developers with a number of tools that can be leveraged by Android game developers.

* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.