I didn't check everything yet but here are already some remarks:
- Your example lacks the include of
<string>
so it doesn't compile this way.
Pretty obviously a copy and paste problem ;-) - Use the same types in for loops.
Currently you are comparingint i
against thesize_t
return value ofstring::size()
.
e.g.for (int i = 0; i < letters.size(); ++i)
should befor (size_t i = 0; i < letters.size(); ++i)
This might not look like a big deal but it will prevent you from unwanted or undefined behaviour unwanted or undefined behaviour. - The last parameter of
getLetterCombos
could be passed as const reference instead of copying the value on every call.
I didn't check everything yet but here are already some remarks:
- Your example lacks the include of
<string>
so it doesn't compile this way.
Pretty obviously a copy and paste problem ;-) - Use the same types in for loops.
Currently you are comparingint i
against thesize_t
return value ofstring::size()
.
e.g.for (int i = 0; i < letters.size(); ++i)
should befor (size_t i = 0; i < letters.size(); ++i)
This might not look like a big deal but it will prevent you from unwanted or undefined behaviour. - The last parameter of
getLetterCombos
could be passed as const reference instead of copying the value on every call.
I didn't check everything yet but here are already some remarks:
- Your example lacks the include of
<string>
so it doesn't compile this way.
Pretty obviously a copy and paste problem ;-) - Use the same types in for loops.
Currently you are comparingint i
against thesize_t
return value ofstring::size()
.
e.g.for (int i = 0; i < letters.size(); ++i)
should befor (size_t i = 0; i < letters.size(); ++i)
This might not look like a big deal but it will prevent you from unwanted or undefined behaviour. - The last parameter of
getLetterCombos
could be passed as const reference instead of copying the value on every call.
I didn't check everything yet but here are already some remarks:
- Your example lacks the include of
<string>
so it doesn't compile this way.
Pretty obviously a copy and paste problem ;-) - Use the same types in for loops.
Currently you are comparingint i
against thesize_t
return value ofstring::size()
.
e.g.for (int i = 0; i < letters.size(); ++i)
should befor (size_t i = 0; i < letters.size(); ++i)
This might not look like a big deal but it will prevent you from unwanted or undefined behaviour. - The last parameter of
getLetterCombos
could be passed as const reference instead of copying the value on every call.
lang-cpp