MAPPING STRINGS WITH INTEGERS

Can anyone tell me how to map strings with integers in ‘C’ programming language?


for example : the strings taken from the input from the user are SUM , DAM , PEN ,PUT ,VAN.
we need to map like this : SUM - 1;
DAM -2;
PEN - 3;
PUT - 4;
VAN -5;

those strings are to be taken from the user input.

prefered: c language

for java ou can look here http://tutorials.jenkov.com/java-collections/map.html but for C you’ll have to implement your own hash table datastructure. this is why C++ and java are most common in programming contests. most important and frequently used data structures are already provided in the standard library.

Well, you can create a double dimensional array and store these strings and use the row numbers as mapping to the strings.

i’m beginner… can u tell me how to implement own hash table in c?? plz.