#include <stdio.h>
#include <math.h>
void int2str(int intval, char* buf) {
int intvallen = log10(intval) + 1;
char* const pStart = buf;
char* const pEnd = buf + intvallen;
for (; intval > 0 && (buf < pEnd); intval /= 10, buf++) {
*buf = '0' + intval % 10;
}
*buf = 0;
strrev(pStart);
}
int main()
{
int n = 89014;
char buf[16] = "";
int2str(n, buf);
printf("%s", buf);
return 0;
}
/*
89014
*/