Open amayaling opened 4 months ago
atoi() already is implemented, but itoa() is not... How about this suggestion: implement sprintf, which is basically printf but for strings. You can reuse a lot of the logic that's already in printf.c but instead apply it to character buffers instead of standard output. Maybe implement sprintf, snprintf and then itoa() would basically just be doing sprintf(buf, "%d", i). What do you think?
I would like to implement atoi() and itoa() [working on the function name]. With both functions there could be flags that determine if the number is converted to binary, hex, or base 10.