>> If u have some handy I appreciate, if not I'll do one myself.
This should work (not thoroughly tested, though):
Code:
char* itoa64( _int64 val, char* str, _int64 rad )
{
int
neg = 0;
char
tmp,
* seq = str,
* ptr = str,
tab[ ] =
{
'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
};
if( val < 0 )
{
val = -val;
neg = 1;
}
if( rad == 10 || ( ( rad == 8 || rad == 16 ) && !neg ) )
{
if( rad == 16 )
*ptr++ = 'h';
do
{
*ptr++ = tab[ val % rad ];
val /= rad;
}
while( val );
if( rad == 8 )
*ptr++ = '0';
else if( neg )
*ptr++ = '-';
}
*ptr = 0;
while( --ptr > seq )
{
tmp = *ptr;
*ptr = *seq;
*seq++ = tmp;
}
return str;
}