Task

Using two Arrays of equal length, create a Hash object
where the elements from one array (the keys) are linked
to the elements of the other (the values)



Related task

   Associative arrays/Creation


 
using Gee;
 
void main(){
    // mostly copied from C# example                                            
    var hashmap = new HashMap<string, string>();
 
    string[] arg_keys = {"foo", "bar", "val"};
    string[] arg_values = {"little", "miss", "muffet"};
 
    if (arg_keys.length	== arg_values.length ){
	for (int i = 0;	i < arg_keys.length; i++){
            hashmap[arg_keys[i]] = arg_values[i];
	}
    }
}
 