213. C++ functions can be called from Fortran if they are declared extern “C” and have C-like arguments.#

topic: Interoperability with C and C++

Note

This tip is a draft1.

C++ functions can be called from Fortran if they are declared extern “C” and have C-like arguments, so the random number generators for uniform and non-uniform distributions in the C++ standard library are accessible through simple wrappers.



1

From the perspective of FortranTip Browser, “draft” means that it hasn’t been edited for formatting, hasn’t had corresponding Fortran programs added, the text content hasn’t been enhanced, etc. Draft texts are extracted from the corresponding Tweet using the Twitter API.