- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Two verybasic questions:
How are local variables saved in memory for a subroutine with the Recursive keyword?
And , how is the SAVE attribute handled in a subroutine with the recursive keyword?
Thanks for any info!
링크가 복사됨
5 응답
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Variables that don't have the SAVE attribute are allocated on the stack. (Allocatable variables have their descriptors on the stack.) Variables with SAVE are statically allocated. Note that data initialization implies SAVE.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Is the following correct:
When a subroutine is recursively called (indirectly) another stack is created for the subroutines local variables, and variables that have the SAVE attributemaybe changed during the recursive call. The final value of the SAVEd variable will be the valueafter the last recursive call.
Thanks for the reply.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Steve:
While searching this Forum for info on stacks, heaps, automatic, recursion, etc. I came across a link to a document that you wrote. Clicking on the link takes me to"Doctor Forum -- Don't Blow Your Stack."However, withinabout 10 secondsthe url is rerouted to an Hp web site, making it impossible to read the document--unless you are a very fast reader. Can you repost the link here?
Thanks.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Better - I'll repost all my Doctor Fortran articles. Stay tuned.
