View Single Post
  #2 (permalink)  
Old 11-28-2006, 10:30 PM
Lop's Avatar   
Lop Lop is offline
Speaks fluent binary
 
Join Date: May 2006
Posts: 1,149
Rep Power: 18
Lop will become famous soon enoughLop will become famous soon enough
Default

You are not storing your remainders anywhere.

It should look like this (your math):
5 ) 559
-----
5 ) 111 r 4
-----
5 ) 22 r 1
----
5 ) 4 r 2
---
0 r 4 = 4214 (base 5)

And then for the base 16 you are going to need something like this:

Code:
const char ccBaseChars[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
And then called like this:
Code:
ccBaseChars [Remainder];
__________________
Lop
Reply With Quote