Jump to content

Type detection: Difference between revisions

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
1,448

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.