double linked list -- deallocate all list

double linked list -- deallocate all list

hi everyone,In my program I create a double linked list.I would like to know if it is possible to deallocate all the list in a simple way.I mean, Can I apply a sort of code like:

or, as I suppose, I have to move across the entire list and ramove the node one by one?In the second case how can I do?cheers

2 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.

I am going to assume you are coding in Fortran, as the syntax you show is closer to Fortran than C/C++.

In order to have a linked list you would have to use POINTER components of a derived type. There is no way to deallocate the whole list in one statement.

If you need further help on Fortran, please ask in one of our Fortran-specific forums. We have one for Windows and another for Linux/Mac.


Melden Sie sich an, um einen Kommentar zu hinterlassen.