```
/*****************************************
* Written by Mathias Van Malderen
* Copyright (c) 2009 Mathias Van Malderen
******************************************/
/***************************
itos(int a)
****************************/
string itos(int a)
{
/* Convert an integer to a string */
int b = 0, c = 1, n = 0;
string result;
while(apow(10,n) < a) n++;
if(n != 0) n--;
b = apow(10,n);
while((b*c) < a) c++;
if(n != 0) c--;
a -= (b*c);
result += digit2str(c);
if(n != 0) result += itos(a);
return result;
}
/***************************
DEPENDENCIES
****************************/
int apow(const int &x, int y)
{
/* Raise x to the power of y */
int result = 1;
if(y < 0)
return apow(1/x, -y);
for(int i = y; i > 0; i--)
result *= x;
return result;
}
string digit2str(short digit)
{
/* Convert a digit to a string */
string tmp;
if(digit >= 0 && digit <= 9)
{
tmp = digit + '0';
return tmp;
}
return "";
}
```

The article starter has earned a lot of community kudos, and such articles offer a bounty for quality replies.