Recommended: Sing it, brah! 5 fabulous songs for developers
JW's Top 5
Hi. I'm tyring to create a couple of data structures - for example, one is a hash containing an integer key and a linked list. my problem is that i'd like to create an initially unknown number of those hashes and therefore i need a way to dynamically name each hash and each linked list.
i'm creating a program that relates to financial services and i want to solicit orders from a user. each time the user enters an order with a new symbol, i want to create a hash for that symbol, use the limit price of their order as the key value and enter the order into the linked list. as new orders come in using the same symbol, i would enter them into the linked list which would allow me to have a time ordered order storage.
but i don't know how to assign a name to a hash or linked list (or any other data type for that matter) dynamically.
for example, if the order is buy 20 shares of IBM at $20.50, i'd like to create a hash called buyIBM, put the key in as 2050 and create (or add to, if it's already there) a linked list called buyIBM2050.
thank you in advance for helping and please assume i'm very, very stupid and explain in as much detail as you have patience for.