Get specific item by index from DList

TheDGuy via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jun 22 15:10:09 PDT 2016


Hi,

i am currently programming a small game with GTKD and i have to 
use a Dlist because an array is static but i want to add user 
inputs dynamically to a list. Now i am wondering how i can get a 
specific item from that list? I read that this isn't possible but 
is it possible to convert that DList temporarily to an array to 
get a specific element? My DList just contains integer values, 
anyone who could offer a short code example?
This doesn't work:

to!Array(level,int,userInput)[i])

Level is the length of the list, int is the type and userInput is 
the DList.


More information about the Digitalmars-d-learn mailing list