Associative arrays in C

前端 未结 7 1330
感动是毒
感动是毒 2020-12-01 00:33

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 inpu

7条回答
  •  不知归路
    2020-12-01 01:25

    Yes, but it will not work in the way you have specified. It will instead use a struct to store the data and functions that operate on that struct, giving you the result you want. See A Simple Associative Array Library In C. Example of use:

    struct map_t *test;
    
    test=map_create();
    map_set(test,"One","Won");
    map_set(test,"Two","Too");
    map_set(test,"Four","Fore");
    

提交回复
热议问题