Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Does C have associative arrays?

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


  2. #2
    Linux Guru
    Join Date
    Dec 2013
    Victoria, B.C. Canada
    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.

Posting Permissions

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