-
binary to decimal
I need to write a program that takes a user inputed binary "1001101" and turns it into decimal form. I know how to switch from digit to digit using modulus and /. I just dont know how to take the digits and assign a value from there. Any suggestions on what i can do?
This is my 2nd program so anything advanced i probably wont know.
-
Re: binary to decimal
Hello,
I hope that this FAQ Integer to string and vice-verca for any base will be of use.
Regards,
Pravin.
-
Re: binary to decimal
Another way - using strtol (or _tcstol) C-runtime function with the base set to 2.