Тема: map+map
Показать сообщение отдельно
Старый 20.04.2006, 14:58   #7  
Roman777 is offline
Roman777
NavAx
Аватар для Roman777
NavAx Club
 
320 / 64 (3) ++++
Регистрация: 10.02.2005
Адрес: г. Москва
Вот так должно работать:

PHP код:
static void Job11(Args _args)
{
    
map         mapSource1  = new Map(Types::StringTypes::Integer);
    
map         mapSource2  = new Map(Types::StringTypes::Integer);
    
map         mapDest     = new Map(Types::StringTypes::Integer);
    
MapIterator mi;
    ;

    
// .. некая инициализация  mapSource1, mapSource2 -->
    // ..
    // .. некая инициализация  mapSource1, mapSource2 <--


    
mi = new mapIterator(mapSource1);
    
mi.begin();
    while (
mi.more())
    {
        if (
mapSource2.exists(mi.key()))
        {
            
mapDest.insert(mi.key(), mi.value() + mapSource2.lookup(mi.key()));
        }
        
mi.next();
    }

За это сообщение автора поблагодарили: Aslan (1).