Trying to find a code to convert any base to any base, (the user specifies). I can convert numbers well, under base 10. The numbers mixed with letters confuses me. Do I read it as a string or integer? Should I use a list or dictionary? My brother is trying to teach me too. I'm just looking to see if anyone else has any different ideas on how to do this. Thanks in Advance.

Recommended Answers

All 2 Replies

Google for "convert 'base 16'" which will hit on general conversions also. The math is straightforward and on a lot of sites, as well as how letters are used.

For any base other than 10 you best use strings. Also base 36 is about the highest you can go with letters from 0 - 9 and A - Z.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.