Skip to content

Latest commit

 

History

History
26 lines (21 loc) · 602 Bytes

end.md

File metadata and controls

26 lines (21 loc) · 602 Bytes

end

Description : This function is used to return an iterator pointing to past the last element of the map container.

Example :

// Demonstrates end()
#include <iostream> 
#include <map> 
  
int main() { 
    // declaration of map container 
    std::map<char, int> mymap; 
    mymap['a'] = 1; 
    mymap['b'] = 2; 
    mymap['c'] = 3; 
  
    // using end() to print map 
    for (auto it = mymap.begin(); it != mymap.end(); ++it) 
        std::cout << it->first << " = "
             << it->second << '\n'; 
    return 0; 
} 

Run Code