Find the answer to your Linux question:
Results 1 to 2 of 2
...if not, can they be simulated? How? thanx....
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux User
    Join Date
    Mar 2013
    Posts
    354

    Does C have associative arrays?


    ...if not, can they be simulated? How?

    thanx.

  2. #2
    Linux Engineer
    Join Date
    Dec 2013
    Posts
    1,281
    C doesn't have an associative array built in.

    To implement an associative array you need a storage scheme and a hash function. The key is hashed and provides an index to the stored data. Associative array - Wikipedia, the free encyclopedia

    Glib does provide a hash table implementation so you don't actually have to do it yourself. https://developer.gnome.org/glib/2.3...sh-Tables.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •