C++/Map Multimap/map empty — различия между версиями

Материал из C\C++ эксперт
Перейти к: навигация, поиск
м (1 версия: Импорт контента...)
 
м (1 версия: Импорт контента...)
 
(нет различий)

Текущая версия на 10:27, 25 мая 2010

Is map empty

  
#include <map>
#include <iostream>
#include <string>
using namespace std;
typedef map<string, int> STRING2INT;
int main(void)
{
    STRING2INT DateMap;
    STRING2INT::iterator DateIterator;
    string DateBuffer;
    if(!DateMap.empty())
        cout << "DateMap has " << DateMap.size() << " entries" << endl;
    else
        cout << "DateMap is empty" << endl;
        cout << "Entering new entries in DateMap" << endl;
 }