The fact that I have to answer this question for myself is crazy, but that's how.
The difference is that you cannot "call functions like in other languages" in Fortran. In C, you can call an integer function without assigning a value, e.g.
int foo() { return 5; } int main() { foo();
In Fortran, you always need to bind a host variable. Example
module test implicit none contains integer function foo() print *, "hello" foo = 0 end function end module program hello use test integer :: x x = foo() ! this works foo() ! this does not compile end program hello
The meaning of this is that to "emulate" the void function, returning an integer of fictitious ones will still not allow you to call without a receiver variable.
In Fortran, the void return type does not exist. Technically, you can structure your program with all the functions, replace all occurrences of the call operator with x = , as shown above, but this will not make your syntax look like C or other languages โโin any case where there is no difference between void - return functions and non-empty return functions. routines are the only objects that allow you to "return void", but the semantics for making a call are just different. In addition, there is no difference between them.
source share