Re: associative array with element type struct ?

2021-09-23 Thread Paul via Digitalmars-d-learn
Of course! And it's very common. <= lol Thanks Ali. Much appreciated!

Re: associative array with element type struct ?

2021-09-23 Thread Ali Çehreli via Digitalmars-d-learn
On 9/23/21 3:06 PM, Paul wrote: > Can I have an associative array with the element type being a struct? Of course! And it's very common. :) > ...this > 26 // simple dual tone key struct > 27 struct keytones { ushort rowFreq; ushort colFreq; } > 28 > 29 // keypad associative array > 30

associative array with element type struct ?

2021-09-23 Thread Paul via Digitalmars-d-learn
Can I have an associative array with the element type being a struct? ..this 26 // simple dual tone key struct 27 struct keytones { ushort rowFreq; ushort colFreq; } 28 29 // keypad associative array 30 keytones[string] keypad; 31 keypad["1"].rowFreq = 697; keypad["1"].colFreq = 1209;