Page 2 of 2

Re:itoa please...

Posted: Thu Oct 03, 2002 9:01 am
by Pype.Clicker
1) don't forget to put a trailing \0 in your generated string!
2) you're writing in the void* ! what's that char* stringout that is never initialized ?? do you think this is OS programming ? goto java!
In C, a good prototype for an itoa() function is

char* int_to_string(long num, char* buffer, int space_left_in_buffer)

3) what is your 'if(!num) {...}' block supposed to do ?