What is the easiest way to go about prefilling a hashtable for a program where the data in the table will never be modified and only referenced. For example we may has 3 houses where the key could represent the house number and the data could be the number of bedrooms and the number bathrooms.Is there a way to pre-create this so we can just reference it rather than filling it as we go?
Asked
Active
Viewed 36 times
0
-
If you're on Linux, maybe the gperf program can help? – Bjorn A. Nov 04 '16 at 17:19
-
Your hashtable is probably an array of struct, or simple types. Just look up how initialization works in C. Perhaps start here :http://stackoverflow.com/questions/330793/how-to-initialize-a-struct-in-accordance-with-c-programming-language-standards – infixed Nov 04 '16 at 17:25