I\'m trying to write a function that\'ll convert an integer to a string like this, but I can\'t figure out the logic... :(
1 = a 5 = e 27 = aa 28 = ab etc...
void convert(int number) { string str = ""; while(number) { char ch; ch = (number - 1) % 26 + 65; str = ch + str; number = (number-1) / 26; } cout << str << endl; }