scala can make mapping (ADT) so we can mapping like this (‘A’, 3) = (Char, Int)
how about in C?
I want to mapping and check all the relations and comparing between two maps
‘a’ = 1, ‘b’ = 3, ‘c’ = 4 is mapping by abbbcccc
and ‘e’ = 1 , ‘b’ = 3, ‘g’ = 4 is mapping by bbbegggg
I want to find these relation (‘a’ , 1) is not in (‘e’ = 1 , ‘b’ = 3, ‘g’ = 4). then, this map
(‘b’ = 3) is in (‘e’ = 1 , ‘b’ = 3, ‘g’ = 4) this map. and count++;
How I can make these like maps? can I make it by array?
Not in plain C, no.
You could implement one with an array or two, but you would have to implement either a hashing algorithm, or some kind of comparison and search algorithm. Alternatively you could use some kind of search tree to implement it.
If you don’t want to write a map data type, you will have to use a library with that functionality. GLib contains one: http://developer.gnome.org/glib/2.30/glib-Hash-Tables.html