Updated comment explaining function

master
Aadhavan Srinivasan 10 months ago
parent 986e386098
commit f840ff9c00

@ -13,7 +13,7 @@ unsigned int to_decimal(std::string num, int from_base) {
/* Here, we convert 'num' to decimal (base 10) - Find the index of /* Here, we convert 'num' to decimal (base 10) - Find the index of
every character in the string, in 'possible_chars' and every character in the string, in 'possible_chars' and
compute the value using */ compute the value using the position of the character in the number. */
for (int i=0; i < (int)num.length(); i++) { for (int i=0; i < (int)num.length(); i++) {
current_char = num.at(i); current_char = num.at(i);
index = possible_chars.find(toupper(current_char)); // Convert the character to upper-case, so that the earliest match is detected index = possible_chars.find(toupper(current_char)); // Convert the character to upper-case, so that the earliest match is detected

Loading…
Cancel
Save