Quantcast
Channel: Intel® Software - Intel® Visual Fortran Compiler for Windows*
Viewing all articles
Browse latest Browse all 5691

Retention of allocated memory within a subroutine that is called multiple times

$
0
0

I have a question about what happens to memory allocated within a subroutine if that subroutine is called multiple times. For example, when I call it for the first time the subroutine ALLOCATEs some memory for an array, puts some data into the array and then exits (no DEALLOCATE is done). If I call the subroutine again will the data in that array still be reliably available and intact? If I put the array into a SAVE statement within the subroutine would that make any difference?

Regards,
Peter
 

Zone: 


Viewing all articles
Browse latest Browse all 5691

Trending Articles