![]() |
|
#1
|
|||
|
|||
Decimal to binary conversion |
|
#2
|
|||
|
|||
Re: Decimal to binary conversionQuote:
Please state the problem precisely: Your example makes no sense. The ascii value for the character 'A' is 65 decimal (41 hexadecimal). The bits you show are for 4d hexadecimal (77 decimal). 4d hexadecimal is the ascii value for 'M' What do you really want the program to do? Be specific. Before you start to write a program, I recommend that you follow at least these three steps: 1. Describe the input. How is the input obtained? (Keyboard, file, or what?) Is the program going to act on one input character, or is it going to process more than one character. (And, if it is going to process more than one, how will the program know when to stop?) 2. Describe exactly what the program is going to do with the input character(s). (Convert to decimal digits, convert to hexadecimal digits, convert to binary digits, or what?) 3. Describe exactly what output is going to be generated by the program (print binary digits, or what?) Regards, Dave |
|
#3
|
||||
|
||||
Re: Decimal to binary conversionYou need to understand the difference between character/decimal/hex/binary representation of a single integer/character variable.
Put this into a program that inputs your character and see what comes out: CPP / C++ / C Code:
Then you need to understand bit manipulation. The operators |Once you understand these operators, you have the background to do the program. Then we can help you clean up your code. By the way, did you read the Guidelines? They are important too. __________________
Age is unimportant -- except in cheese |
|
#4
|
|||
|
|||
Re: Decimal to binary conversionQuote:
We kind of covered that part in a previous thread http://www.gidforums.com/t-7569.html, but since the thread seemed to die a quiet and non-productive death, I guess there's no harm in trying again. I was just trying to get a clear statement of the problem. Regards, Dave |
Recent GIDBlog
Meeting the local Iraqis by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Re: Conversion: Binary, Decimal, Hexadecimal | WaltP | C Programming Language | 1 | 10-May-2006 06:49 |
| Roman to decimal to roman | SpudNuts | C++ Forum | 2 | 16-Feb-2005 19:44 |
| Hex Result giving strange answers. | Rosdahale | C Programming Language | 6 | 07-Dec-2004 20:28 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The