50 Points

itoa

Darn! You left your stdlib at home again! Without your essential C libaries, you need to write a function that, given an integer converts it to a string.

Start writing your function using this wrapper. Feel free to adapt it to your language of choice.

#include <stdlib.h>
#include <stdio.h>

char * myItoa(int number) {
    return "Implement Me!";
}

int main() {
    int number;
    scanf("%d", &number);
    char * numberAsString = myItoa(number);
    printf("%s\n", numberAsString);
}

Restrictions

  • sscanf or alike are not allowed
  • You are to implement the conversion. No library calls allowed

Example Input

1000

Example Output

1000

Example Input

-1872

Example Output

-1872