> That is how I get the binary.
That's how you do it for every other base as well.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
Well it's good for bases < 10
char basechars[] = "0123456789";
and printf("%c", basechars[r] );
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
Store each char in another array, then print it out backwards?
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
> basechars[r]
You're printing them, not storing them!
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
result[numchars++] = basechars[r];
When you're done, print from numchars-1 back down to 0 (one char at a time).
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
Post your code!
Did you initialise i ?
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953