Quantcast
Channel: Fortran
Viewing all articles
Browse latest Browse all 3108

Recursive routines - execution order

$
0
0

I was wondering if when a recursive routine calls itself, what happens to statements AFTER the call.

Example:

subroutine SUB1(isq)

call sub1(isq+1)

print *,"Does it ever get here?"

print *,isq+1

end

Now if it has a condition such that it SKIPS the call to itself, it will reach the PRINT statement.

But I have seen situations where it got there anyway, and I can't figure out why that would happen.


Viewing all articles
Browse latest Browse all 3108

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>