Type detection: Difference between revisions
→Generic procedures (overloading)
Line 719:
===Generic procedures (overloading)===
In the following, the name ''print_text'' refers to two distinct subroutines. Which of the two is called depends on the type of the argument in the call; the decision is made ''at compile time''.
(To use this mechanism in a library, one would want to use modules. Nevertheless, the program below illustrates the principle more simply.)
<lang fortran>program type_detection_demo
|