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?

    thanx.

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