title: Associative arrays in C
body: <p>I am implementing a way to transfer a set of data to a programmable dongle. The dongle is based on a smart card technology and can execute an arbitrary code inside. The input and output data is passed as a binary blocks that can be accessed via input and output pointers.</p>
  
  <p>I would like to use an associative array to simplify the data processing code. Everything should work this way:</p>
  
  <p>First the host application:</p>
  
  <pre><code>// Host application in C++
  in_data["method"] = "calc_r";
  in_data["id"] = 12;
  in_data["loc_a"] = 56.19;
  in_data["loc_l"] = 44.02;
  processor-&gt;send(in_data);
  </code></pre>
  
  <p>Next the code inside the dongle:</p>
  
  <pre><code>// Some dongle function in C
  char* method_name = assoc_get_string(in_data, "method");
  int id = assoc_get_int(in_data, "id");
  float loc_a = assoc_get_float(in_data, "loc_a");
  float loc_l = assoc_get_float(in_data, "loc_l");
  </code></pre>
  
  <p>So my question is about the dongle part functionality. Is there C code or library to implement such an associative array behavior like the above?</p>