Quote:

>> Write a function which converts a number from an arbitrary base between

>> 2 and 9 to base 10. Assume the input is a valid number in the input

>> base, and the base is always between 2 and 9.

>> /* spec: */ int convert(int number, int base);

MA> I must admit not having the slightest idea what this question

MA> means, since the input int and the output int are base 2 on a

MA> binary machine.

An example call would be:

base10 = convert(1567, 8);

base10 should contain the value equal to: 7 + 6*8 + 5*8*8 + 1*8*8*8

-- James

[Oh, you mean strtol((sprintf(buf, "%d", 1567),buf), 0, 8) -mod]