This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: help: interfacing between C and fortran program


Am Mittwoch, 14. September 2005 08:39 schrieb Gaurav Gautam, Noida:
> Hi,
>
>
> I have a function written in fortran say fun(x, y), with x and y as integer
> (scalars) . Function returns integer.
>
>
> I need to call this function from a C program. How do I do it.
> Can some one help me.
>
> Does Gfortran and gcc support this. ??
>
>
> Regards
> Gaurav

Yes, of course you can interface the function from C.  There are some hints 
how to write the exact interface prototypes for your C/C++ function 
declaration on the `info g77' info pages.

You should try to use f2c to generate your interfaces at least for the first 
time.  See the hints on the info pages:

# info g77 "Other Languages" "Interoperating"

There you will find all you need !

Attachment: pgp00000.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]