-
October 3rd, 2007, 11:39 PM
#1
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.
-
October 4th, 2007, 12:04 AM
#2
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.
-
October 4th, 2007, 03:53 AM
#3
Re: binary to decimal
Another way - using strtol (or _tcstol) C-runtime function with the base set to 2.
Victor Nijegorodov
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|