i have an assignment:
Write a recursive function that will compute the value of
a representation of a number in given base.
int base(char num[], int radix);
For example, calling the function as
base("1011", 2)
should return 11, but calling it as
base("1011", 10)
should return 1011.
i need to support bases 2–36. “Digits” greater than
9 are encoded as lowercase or uppercase letters. E.g.,
base("Cafe", 16)
returns 51966 = 12 · 163 + 10 · 162 + 15 · 161 + 14 · 160.
i can not use loops or string / math library functions.
i will probably need a helper recursive function.
now, i think that the helper function should calculate the power of the base and add it to the base function , but i dont know how to do it