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

Making an independent duplicate of a linked list

$
0
0

I was wondering about something: does anyone know of a slick way to make a copy of a linked list so that the pointers in the new list don't point back to the original list?  Basically, to clone it so that the two are complete independent, but contain the same data.  allocate(new,source=old) doesn't work because the new pointers point the same locations as the old ones.  I suspect such a thing isn't possible, without manually traversing the structure, but was wondering if anyone had any ideas.  I think the Fortran 2008 "Allocatable components of recursive type" feature might make something like this easier?


Viewing all articles
Browse latest Browse all 5691

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>