map::empty function


The map::empty function checks if the map is empty.

bool empty() const;

Parameters:
none

Return type
bool -True if the map is empty(contain no elements) else false.

Code example

map<int,int> m{{ 90 , 900 } , {34, 340 }} ,
mm ;

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

Output

0 (false)
1 (true)


 


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