i understood almost anything

so how becomes my function that read a number (base other than 10) from scanf

then read (scanf) the number base

and convert it to 10-base??

Code:

int n, base;
printf ("Enter a number: ");
scanf ("%d",&n);
printf ("enter base of the number inserted: ");
scanf ("%d",&base);
...

so should i use a function like this?

Code:

int convert_base_to_10(int base, int x) {
return (x < base) ? x : convert_base_to_10(base, x / 10) * base + (x % 10);
}

and there is not a "direct" function to conversion like the reverse itoa??