[an error occurred while processing this directive]
|
void Command::IntToString(char *string, int x)
{
char *ptr,*bufptr,flag;
char buf[6];
ptr = string;
bufptr = buf;
if(x < 0) { *ptr++ = '-'; x = -x; }
else *ptr++ = ' ';
flag = 1;
while(x)
{
*bufptr = x % 10; x /= 10;
if(*bufptr) flag = 0;
*bufptr++ = '0'+*bufptr;
}
if(flag) *ptr++ = '0';
else
while(bufptr > buf) *ptr++ = *--bufptr;
*ptr = 0;
}
E-mail: info@telesys.ru