Dynamically enumerate keys in libconfig <p>in <code>libconfig</code> - is it possible to dymanically enumerate keys?</p> <p>As an example, in this <a href="https://github.com/hyperrealm/libconfig/blob/master/examples/c/example.cfg" rel="nofollow">example</a> config file from their repo - if someone invented more days in the <code>hours</code> section, could the code dynamically enumerate them and print them out?</p> <p>Looking at the docs, I see lots of code to get a specific string, or list out an array, but I can't find an example where it enumerates the keys of a config section. </p> <p><strong>Edit</strong></p> <p>Received some downvotes, so thought I'd have another crack at being more specific. </p> <p>I'd like to use libconfig to track some state in my application, read in the last known state when the app starts, and write it out again when it exits. My app stores things in a tree (of depth 2) - so this could be niceley represented as an associative array in a libconfig compatible file as below. The point is that the list of Ids (<code>1234/4567</code>) can change. I could track them in another array, but if I could just enumerate the 'keys' in the <code>ids</code> array below - that would be neater.</p> <p>so </p> <pre><code>ids = { "1234" = [1,2,3] "4567" = [9,10,11,23] } </code></pre> <p>e.g (psuedocode)</p> <pre><code>foreach $key(config_get_keys_under(&amp;configroot)){ config_get_String($key) } </code></pre> <p>I can't see anything obvious in the header file. </p>