Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

calling C/C++ from fortran

roddur
Beginner
618 Views
dear friend,
can you give a detailed example of calling C/C++ program by a fortran program?
i have very litle idea of C and dont know how to do that.

I know basic C language but not an expert and calling a C function from fortran is giving trouble. It is enough if you show me how a C/C++ "hello world" function can be called by a fortran program
0 Kudos
1 Reply
Steven_L_Intel1
Employee
618 Views
See the attached tar file. Here's an example of building and running it.

[sblionel@f90srv17 ~]$ g++ -c Csub.cpp
[sblionel@f90srv17 ~]$ ifort Fmain.f90 Csub.o
[sblionel@f90srv17 ~]$ ./a.out
Testing...123

Let me know if you have questions.

0 Kudos
Reply