Alex Rivera | Logout

How to represent a Python-like dictionary in C

Asked 2010-07-17T01:44:43.393
9

In Python it's easy:

x = {}
x['USD'] = "Dollars"
x['CLP'] = "Pesos"

or

y = {'lat': 23.678900, 'lng': 121.451928, 'name': "Sin City"}

I think most of these kinds of problems have been solved, so where can I get information about dictionaries in C? I do not want to reinvent the wheel.

How do I implement a dictionary in C?

Edit
Report

1 Answer

1

All your questions are answered here.

The idea: use a hash function avoiding collisions to use them as an index.

answered 2010-07-17T01:52:02.837

Your Answer