double linked list -- deallocate all list

double linked list -- deallocate all list

Аватар пользователя diedro

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 posts / 0 новое
Последнее сообщение
Пожалуйста, обратитесь к странице Уведомление об оптимизации для более подробной информации относительно производительности и оптимизации в программных продуктах компании Intel.
Аватар пользователя Steve Lionel (Intel)

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.


Зарегистрируйтесь, чтобы оставить комментарий.