Software Archive
Read-only legacy content
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17060 Discussions

How to define temporary arryas at execution time?

WSinc
New Contributor I
499 Views
I want to set up something like the NEW statement in C++, where I don't want to allocate permanent storage, but only according to the size of the problem at execution time.

Does Fortran allow me to define an array that does not exist at compilation time, where the size can be defined by user input?

Even in some versions of C++ the user has to commit himself at compilation time regarding the sizes of arrays.
0 Kudos
1 Reply
Steven_L_Intel1
Employee
499 Views
Yes. Look at ALLOCATABLE arrays. If an ALLOCATABLE array is a local variable in a routine, and not given the SAVE attribute, it gets automatically deallocated on routine exit.

Steve
0 Kudos
Reply