itoa please...

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:itoa please...

Post 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 ?
Post Reply