how would i convert a number of one base into the same number in a different base for example how would i get a 10 in base of 4 to the 4 it is in a base of 10?
how would i convert a number of one base into the same number in a different base for example how would i get a 10 in base of 4 to the 4 it is in a base of 10?
In a perfect world every dog would have a home and every home would have a dog.
Visit My Web Site, Canine Programming
I use Win32 API
What do you mean, "base"?
1978 Silver Anniversary Corvette
well, our number system is in a base of ten it only has ten possible digits in a base of four it goes 0,1,2,3,10 using only four digits. i need to know how to convert them
In a perfect world every dog would have a home and every home would have a dog.
Visit My Web Site, Canine Programming
I use Win32 API
So, what are the four digits of the 4 based system?
1978 Silver Anniversary Corvette
_itoa() will convert an integer to a string and allows you to specify the base, or you could do something like -
int a= 5;
int base = 4;
int b = a/base*10 + a%base;
//b will contain 11 in this case
zen