Created
July 4, 2019 06:33
-
-
Save Utshaw/669ce8cc4ef78ea16638628a074a15b7 to your computer and use it in GitHub Desktop.
check for a key and insert if not exists
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
map<char, int> :: iterator iter = charFrequency.find(a); | |
if(iter == charFrequency.end() ){ // not found | |
charFrequency.insert({a, 1}); | |
}else{ // found | |
iter->second = iter->second + 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment