S
SneakyElf
i have written code in java, how would it look in c++?
int amtOfLetters = currInput.length;
HashMap letters = new HashMap(amtOfLetters);
for(int currCharPos = 0; currCharPos < amtOfLetters; currCharPos++) {
if (letters.get(currInput[currCharPos]) == null) {//doesn't exist yet
letters.put(currInput[currCharPos], 1)
} else {//if it is already there
letters.put(currInput[currCharPos],
letters.get(currInput[currCharPos]) + 1)
thank you.
int amtOfLetters = currInput.length;
HashMap letters = new HashMap(amtOfLetters);
for(int currCharPos = 0; currCharPos < amtOfLetters; currCharPos++) {
if (letters.get(currInput[currCharPos]) == null) {//doesn't exist yet
letters.put(currInput[currCharPos], 1)
} else {//if it is already there
letters.put(currInput[currCharPos],
letters.get(currInput[currCharPos]) + 1)
thank you.