| | |
how to convert Binary numbers to decimal numbers and decimal numbers to binary
![]() |
How to convert binary numbers to decimal numbers and decimal numbers to binary numbers?
help!!!!!!
help!!!!!!
Last edited by Ancient Dragon; Feb 9th, 2009 at 7:56 pm. Reason: deleted color and bold tabs
Re: how to convert Binary numbers to decimal numbers and decimal numbers to binary
0
#2 Feb 9th, 2009
Re: how to convert Binary numbers to decimal numbers and decimal numbers to binary
0
#3 Feb 9th, 2009
If you're using an int variable for keeping a decimal value and you want to convert it into a binary value, you should know how an int is represented.
An "int" uses 32 bits for representing the number. You can use binary operators in C++ to get the bytes. (OR / AND). I suggest that you do a search on what they are and how to use them. If you don't know the binary representation, do the same.
It's very easy to print all the bytes of an int. You can use a printf option of write a loop that will iterate 32 times to print every byte of the int.
An "int" uses 32 bits for representing the number. You can use binary operators in C++ to get the bytes. (OR / AND). I suggest that you do a search on what they are and how to use them. If you don't know the binary representation, do the same.
It's very easy to print all the bytes of an int. You can use a printf option of write a loop that will iterate 32 times to print every byte of the int.
Re: how to convert Binary numbers to decimal numbers and decimal numbers to binary
0
#4 Feb 9th, 2009
![]() |
Similar Threads
- Binary (base 2) to Decimal (base 10) HELP! (C)
- Decimal to Binary Converer (VB.NET)
- How to Converty Binary String of Length 1024 to Decimal Number (C)
- hex string to true binary w. bit manipulation (Java)
- binary to decimal (C)
- Convert negative decimal to binary (Python)
- binary to decimal problem (C++)
- binary to decimal values conversion (C)
- Real number to binary? (C)
Other Threads in the C++ Forum
- Previous Thread: fps troubles
- Next Thread: C++ Debugging
| Thread Tools | Search this Thread |
api application array based binary bitmap c# c++ c/c++ char class classes code coding compile compression console conversion count cpm craigslist delete deploy desktop developer dialog directshow dll download dynamic dynamiccharacterarray email encryption error errors file forms fstream function functions game givemetehcodez graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer introductory java lib linkedlist linkednodes linker loop looping loops map math matrix memory multiple news node numbertoword output pointer problem program programming project python random read recursion reference rpg security sorting string strings temperature template test text text-file tree url variable vector video whyisthiscodecausingsegmentationfault win32 windows winsock wordfrequency wxwidgets





