octal « hex « C Data Type Q&A

Home
C Data Type Q&A
1.binary
2.bit
3.byte
4.char
5.character
6.decimal
7.Development
8.float
9.hex
10.integer
11.prime
12.random
13.struct
C Data Type Q&A » hex » octal 

1. Where did the octal/hex notations come from?    stackoverflow.com

After all of this time, I've never thought to ask this question; I understand this came from c++, but what was the reasoning behind it:

  • Specify decimal numbers as you normally would
  • Specify octal ...

2. Converting Decimal to Hexadecimal and Octal    stackoverflow.com

Show how to write a constant in C, whose decimal value is 65 as a. a hexadecimal constant
65/16 = 1 r1
1/16 = 0 r1
Hexadecimal constant = 11

b. an octal constant (in C)
65/8 ...

3. Altering Char via hex, octal or decimal within C.    forums.devshed.com

I don't know if that explains it either. All data stored in the processor is binary. Floats are stored differently, in order to get range at the expense of precision, but it's still a binary medium, the bit positions just have different meanings. The appearance of binary or octal or decimal or hex or whatever else, in the output, is just ...

4. Convert hex to octal    forums.devshed.com

How does it do that!? An integer is an integer is an integer. Internally it is always binary, and externally is however you wish to represent it. You cannot hold a hexadecimal representation as anything other than a string, and your convert2dec() function does not take a string, it takes an integer. It also returns an int, which is not decimal ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.