Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
map_find
#include <iostream> #include <map> int main () { std::map<char,int> mymap; mymap['a']=50; mymap['b']=100; mymap['c']=150; auto it = mymap.find('b'); if (it != mymap.end()) mymap.erase (it); // print content: std::cout << "elements in mymap:" << '\n'; std::cout << "a => " << mymap.find('a')->second << '\n'; std::cout << "c => " << mymap.find('c')->second << '\n'; return 0; }
run
|
edit
|
history
|
help
0
swastic
compile-time check of existness of method of a class
3
sorting using array and pointer
Test 12(2021)
star print 2
scuba
Overland pg. 68
Empty C++ Script
Two-phase sample with GCC