STL map::size function


The map::size function gives the number of elements in the container.

size_t size( ) const;

Parameters:
none

Return type
size_t -The number of elements in a map.

Code example

map<int,double> m{{23, 23.32} , { 90 , 90.217} },
mm ;

cout<< m.size() << endl
 << mm.size() << endl ;

Output

2
0


 


Stop wasting time,earn money($$$) from your website-Join Now!