Ok, so i was writing a recursive version of itoa. Im interested if there's a way to avoid using static variable: this is what i came up with.

"Write a recursive version of itoa".

Code:void itoa(int n, char s[]) { static int i = 0; if(n < 0) { s[i++] = '-'; } if(n / 10 != 0) itoa(n/10, s); else if(n < 0) i = 1; else i = 0; s[i++] = abs(n % 10) + '0'; s[i] = '\0'; }